現在、を使用してView Controllerを提示しようとしていUIPresentationControllerます。私の問題は、カスタム遷移デリゲートが呼び出されるときです
func presentationControllerForPresentedViewController(presented: UIViewController, presentingViewController presenting: UIViewController!, sourceViewController source: UIViewController) -> UIPresentationController?
提示しているコントローラーがnil原因で、例外がスローされます。タブバーコントローラーに埋め込まれたナビゲーションコントローラーに埋め込まれたビューコントローラーから提示しています。これらのコントローラーからも同じ問題に提示しようとしました。カスタムモーダルプレゼンテーションがない場合にも適切に機能しますが、私の目標はそれをカスタマイズすることです。ボタンが選択されたときに呼び出します。コードは以下のとおりです。mapTransitionDelegateクラスプロパティに保持するカスタム遷移デリゲートです。また、EnlargedMapViewController()遷移するデリゲートが呼び出されるように、カスタム モーダル プレゼンテーションを持つように初期化されます。
var enlargedMapController = EnlargedMapViewController();
enlargedMapController.transitioningDelegate = mapTransitionDelegate;
presentViewController(enlargedMapController, animated: true, completion: nil);
将来の知識のために、この問題が発生している理由を知りたいです。UIPresentationController今のところ、この例外のため、私のサブクラスは初期化されていません。