O'Reilly logo

iOS 8 SDK Development, 2nd Edition by Janie Clayton, Chris Adamson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Exit Segues

There are a few ways we could implement the back button, but the most generally useful is the exit segue. With an exit segue, we can go backward in a navigation, regardless of whether we came by way of push or modal segues.

What’s tricky about exit segues is that they don’t appear on the storyboard the same way push or modal segues do. Instead, their existence is implicit. We can only perform an exit segue if a previous view controller has exposed a method for us to come back to. These methods, commonly called unwind methods, have to follow a certain signature—they take a UIStoryboardSegue parameter and have return type IBAction—but they don’t have to have any code—they just have to exist.

We want our user detail view controller ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required