0
Xcodeを使用する7.3 iPadレイアウトのために2番目のストーリーボードをユニバーサルアプリに追加しました。カスタムセグを除いてすべて正常に動作します。 Main.storyboardではカスタムセグはうまく動作しますが、Main〜iPad.storyboard(iPadデバイスまたはiPadシミュレータ)を実行すると、セグがクラッシュします。 クラッシュレポートには、次のように(2番目の)iPadストーリーボードでクラッシュするカスタムセグ
2016-07-05 11:27:13.900 Quiz Maker[1354:42875] *** Assertion failure in -[UIStoryboardSegueTemplate segueWithDestinationViewController:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3512.60.7/UIStoryboardSegueTemplate.m:85
2016年7月5日11:27:13.926クイズメーカー[1354:42875] ***アプリの終了をキャッチされない例外により 'NSInternalInconsistencyException'、理由に:「を作成できませんでしたクラスのセグエ '(ヌル)'」
がHERESに私のカスタムセグエコード:
import UIKit
class CustomRightSegue: UIStoryboardSegue
{
override func perform()
{
let firstClassView = self.sourceViewController.view
let secondClassView = self.destinationViewController.view
let screenWidth = UIScreen.mainScreen().bounds.size.width
let screenHeight = UIScreen.mainScreen().bounds.size.height
secondClassView.frame = CGRectMake(screenWidth, 0, screenWidth, screenHeight)
if let window = UIApplication.sharedApplication().keyWindow {
window.insertSubview(secondClassView, aboveSubview: firstClassView)
UIView.animateWithDuration(0.4, animations: {() -> Void in
firstClassView.frame = CGRectOffset(firstClassView.frame, -screenWidth, 0)
secondClassView.frame = CGRectOffset(secondClassView.frame, -screenWidth, 0)
}) {(Finished) -> Void in
self.sourceViewController.navigationController?.pushViewController(self.destinationViewController, animated: false)
}
}
}
}
ポイント:あり
は、属性インスペクタの「モジュール」で使用可能なオプションを選択します。 (なぜそれはデフォルトを使用しませんか?!?) –