Reputation: 1
I have this segue in a navigation view controller. This has a ViewController called SectionsTableViewController, and this has a bar button item that I linked to exit action and called "close" action segue.
And in my ViewController I have this cose:
class ViewController: UITableViewController {
@IBAction func close(segue: UIStoryboardSegue) {
print("Hey")
}
}
But it doesn't work.
Upvotes: 0
Views: 295
Reputation: 817
The unwind segue code needs to be in the view controller you're unwinding back to, as opposed to the one with the Stop button. So if your view controllers normally move in this direction:
StartingViewController
-> SectionsTableViewController
you want to put the unwind segue in StartingViewController
.
Putting the unwind in the wrong view controller and not connecting it via Interface Builder are the only possible ways this can go wrong.
Upvotes: 1
Reputation: 321
Did you hook up the method to the object in the storyboard (control + drag to Exit)?
Upvotes: 0