On Segues Types: Unwind

Xanathos
Feb 4, 2021

As I mostly used programmatic navigation with navigationController, I had to re-learn how to use unwind segues. And I found this easy, yet somehow not so intuitive.

Segue creation menu appears from one ViewController to the other

Normally, I expected some interface builder option to create the segue. As this is basically a segue to return to the previous screen, I expected just to drag from the second screen to the previous, or to the exit node of the ViewController. But then, after searching a bit, I remembered that you have to write the code for the segue first.

Once done, if you ctrl+drag the button you want to set as return button to the exit node, and the option to connect it to the unwind function you created will appear.

--

--