I have a parent view controller where a user selects the game they want to play, then a child 1 view controller where the game is played, then a child 2 view controller which shows scores once the game is completed. How do I use the standard back button in child 2 view to get back to the parent view controller. I don't need to pass anything between the child 2 VC and the parent.
I have created an unwind segue in the parentVC
@IBAction func unwindToParentVC(segue: UIStoryBoardSegue) {
}
And I have ctrl dragged from the yellow Child 2 VC icon onto the Exit icon and selected the above unwind segue, but I the back button doesn't seem to fire this segue.
I have read other solutions on SO that say I need to use
override func didMoveToParentViewController(parent: UIViewController?) {
}
But i am not sure how to get the back button to call this method, and what code I need to add in the body of the method. Any help on where I am going wrong much appreciated!