Using Segues to navigate backwards in the navigation stack
suggest changeUnwind Segues
Unwind Segues give you a way to “unwind” the navigation stack and specify a destination to go back to. The signature of this function is key to Interface Builder recognizing it. It must be an
IBActionand take one parameter of typeUIStoryboardSegue. The name of the function does not matter. In fact, the function does not even have to do anything. It’s just there as a marker of which UIViewController is the destination of the Unwind Segue. The Swift sample is Swift 2. In Swift 3 the parameter must be_ segue:so Interface Builder still seesprepareForUnwind:.
Required signature of an unwind segue
Objective C:
-(IBAction)prepareForUnwind:(UIStoryboardSegue *)segue {
}
Swift:
@IBAction func prepareForUnwind(segue: UIStoryboardSegue) {
}
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents