-segueForUnwindingToViewController: fromViewController: identifier: not being called

前端 未结 4 1184
广开言路
广开言路 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-30 00:02

    To add to the answer from @Jeremy, I got unwinding from a modal UIViewController to a UIViewController contained within a UINavigationController to work properly (I.e how I expected it to) using the following within my UINavigationController subclass.

    // Pass to the top-most UIViewController on the stack.
    - (UIStoryboardSegue *)segueForUnwindingToViewController:(UIViewController *)
                 toViewController fromViewController:(UIViewController *)
                 fromViewController identifier:(NSString *)identifier {
       UIViewController *controller = self.topViewController;
       return [controller segueForUnwindingToViewController:toViewController
                                      fromViewController:fromViewController
                                              identifier:identifier];
    }
    

    .. and then implementing the segueForUnwindingToViewController as usual in the actual ViewController inside the UINavigationController.

提交回复
热议问题