- Push segues stack view controllers, while popping 'unstacks' them.
- Modal segues stack view controllers, while unwinding 'unstacks' them.
I am trying to create a custom segue to move between VCs in a linear (flat) hierarchy, in either direction, without stacking in either direction. It would appear that having segues in both directions between VCs prevents dismissal.
Any ideas?
If you don't want any sort of stack, just have your perform method replace the window's root view controller with the destination view controller. The source view controller will then be deallocated (as long as you didn't create any strong reference to it).
A better way to do this, that handles rotations and both orientations, is to add a container view (in IB) to the first controller (make it the size of the whole view), and then connect this custom segue from the embedded controller that you get when you drag in the container view. This code switches out that embedded controller for the other controller.