Cannot Connect Storyboard Unwind Segue

Chris Wagner picture Chris Wagner · Oct 9, 2012 · Viewed 18.2k times · Source

I am attempting to create an unwind segue but nothing will connect to it when ctrl+dragging. Also when I right click on the Exit icon there are no options available.

enter image description here

Any ideas?

Answer

Jon Hess picture Jon Hess · Oct 9, 2012

You need to have an IBAction defined on a view controller that takes an argument of type "UIStoryboardSegue *".

Something like this:

@interface MyViewController
...
- (IBAction)unwindFromConfirmationForm:(UIStoryboardSegue *)segue {
}
...
@end

Swift 3 Version

@IBAction func unwindToViewController(segue: UIStoryboardSegue) {

    //code

}

Provided by DoruChidean in https://stackoverflow.com/a/46199117/250190