Reputation: 790
I'm trying to unwind a UIStoryboardSegue subclass. If the main window's rootViewController is a UIViewController subclass, everything works great.
However, if it's a UINavigationController subclass my segue is never triggered on unwind.
I've created a sample app to demonstrate this, and put it on Github: https://github.com/simonmaddox/CustomUnwindSegue
Upvotes: 0
Views: 1605
Reputation: 790
After using a DTS request on this, Apple suggested the following:
The short answer is that when a UINavigationController is present, SMXViewController is not actually the parent of the presented SMXSecondViewController. As a result, it only has limited involvement in the unwinding process.
...
A way around this implementation detail is to use your own UINavigationController subclass. You can then override -segueForUnwindingToViewController:fromViewController:identifier: to implement your own logic or forward the message to the UINavigationController parent class if it's for an unwind segue you are not interested in.
The full solution also exists on the DTS_Response branch: https://github.com/simonmaddox/CustomUnwindSegue/tree/DTS_Response
Upvotes: 4