unwind with custom segue on UINavigationController pop via “back” button

前端 未结 3 903
青春惊慌失措
青春惊慌失措 2021-02-04 18:32

Simple storyboard setup: UIViewController with UINavigationController. On a table cell click a custom segue pushes a new UIViewController onto the navigation stack. All good. Bu

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-04 19:25

    Have you tried using something like:

    - (UIStoryboardSegue *)segueForUnwindingToViewController:(UIViewController *)toViewController fromViewController:(UIViewController *)fromViewController identifier:(NSString *)identifier
    {
        return [MyCustomSegueInitMethod viewControllerA:vc1 viewControllerB: vcB];
    }
    

    I've never made a custom segue, but assuming they work like all others do when overriding them, as long as your custom segue class is subclassing the UIStoryBoardSegue, it should work...

    Then make sure you've linked your back button to the "exit" icon in the bar underneath the view controller.

提交回复
热议问题