2016-09-13 1 views
1

私のアプリでは、カスタムトランジションに使用されるいくつかのクラスがあります。スイフト3より前はすべてうまくいっていました。しかし、Swift 3に更新した後、func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController)は常にと表示され、はゼロとして表示されます。これは、移行を開始しているUIViewControllerを返すことになっています。すべては以前のSwiftバージョンと完全に連携していました。私は何か不足していますか?Swift 3:UIViewControllerTransitioningDelegateは動作を停止しました

+0

解決方法はありますか?同じ問題を抱えている – chrismanderson

答えて

2

私はこの問題に1時間以上ぶつかっていましたが、すぐに3.0では機能署名の規則が変更されていますので、この変更によって問題が発生する可能性があります。プロトコルメソッドはオプションなので、呼び出されず、エラーも返されませんでした。

func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? { 
    return ... 
} 

func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { 
    return... 
} 
関連する問題