In my simple app, I have created some controllers with basic segues between them:
Yellow controller -> BlueController -> GreenController -> OrangeController. Every of them has its own custom class.
From OrangeController I created unwindSegue to my YellowController. It is ok.
Within every class I put:
override func unwindForSegue(unwindSegue: UIStoryboardSegue, towardsViewController subsequentVC: UIViewController) {
print(unwindSegue)
print(subsequentVC)
}
But it was not called at all. Why? What demo should I prepare to test this functionality?
The same is with:
func allowedChildViewControllersForUnwindingFromSource(source: UIStoryboardUnwindSegueSource) -> [UIViewController]
func childViewControllerContainingSegueSource(source: UIStoryboardUnwindSegueSource) -> UIViewController?
Implement the method with IBAction
returnType
-(IBAction) unwindForSegue:(nonnull UIStoryboardSegue *)unwindSegue towardsViewController:(nonnull UIViewController *)subsequentVC
In Storyboard
, link the control (which is responsible for the back action) to the exit action in the viewcontroller.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With