How to dismiss all views except the first view

Hello everyone!

I'm just curious about how to go about attaching a button to an action or segue that would dismiss all views except for the first one. I don't want to just add another connection because then it is just messing with the view hierarchy. I want to try and make this process as power and performance efficient as possible.


Thanks!

🙂

You can get a good example of using unwind segues by viewing this tech note from Apple (TN2298). The basic idea is to use an exit segue and an unwind function (that would reside in the desired target view controller class). Then ctrl drag from your button to the red exit segue button at the top of your storyboard scene.Next select the unwind function you want to go to and the current view controller will unwind to the desired target when the button is clicked.

How to dismiss all views except the first view
 
 
Q