Reputation: 369
How can I unwind through multiple view controllers without displaying each one sequentially?
I have 3 view controllers, let's call them A, B, and C.
A uses presentViewController to present B, and B does the same with C. When I use an unwind method from C, first C vanishes, showing B, and then B vanishes, showing A. How can I get it to return to A directly, without ever displaying B?
Upvotes: 3
Views: 244
Reputation: 36640
How an Unwind Segue Determines its Destination View Controller
When an unwind segue is initiated, it must first locate the nearest view controller in the navigation hierarchy which implements the unwind action specified when the unwind segue was created. This view controller becomes the destination of the unwind segue. If no suitable view controller is found, the unwind segue is aborted.
This link contains information for setting up the unwind segue process as well.
Upvotes: 2