-segueForUnwindingToViewController: fromViewController: identifier: not being called

前端 未结 4 1193
广开言路
广开言路 2020-12-29 23:28

I have created a custom segue that presents a view controller inside a container that is very similar with Apple\'s own modal view controllers (I\'ve implemented it as a UIV

4条回答
  •  孤独总比滥情好
    2020-12-29 23:51

    This method should be declared on the parent controller. So if you're using a Navigation Controller with a custom segue, subclass UINavigationController and define this method on it. If you would rather define it on one of the UINavigationController's child views, you can override canPerformUnwindSegueAction:fromViewController:withSender on the UINavigationController to have it search the children for a handler.

    If you're using an embedded view (container view), then define it on the parent view controller.

    See the last 10 minutes of WWDC 2012 Session 407 - Adopting Storyboards in Your App to understand why this works!

提交回复
热议问题