I have seen a few questions asking this question, but the answers do not seem conclusive. Using XCode 7 with iOS 9, I want to unwind to a main menu view controller from an arbitrary number of child view controllers. I expected something like the following to do what I need:
@IBAction func returnToMenuScreen(segue: UIStoryboardSegue) {
let departureController = segue.sourceViewController
if departureController.title == "ChildViewController" {
print("ChildViewController")
self.performSegueWithIdentifier("NewSegue", sender: departureController)
}
}
The print function is called, but the performSegueWithIdentifier is not. Similar questions seem to point to a timing issue, but I am having no luck.
To summarize, how can navigate between children view controllers of a parent view controller? I want to unwind to parent then segue to an arbitrary child view controller. Any and all help is appreciated!
I tried to understand you question, But your data is not adequate to find a solution to your problem. May be you didn't wire up correctly unwind function. S o it's better to follow some tutorials about unwind segues. Here is the link of apple, which describe about unwind segue. Go to bottom of this given link. Then you can find out how to unwind segue correctly. hope that this link will help to find your problem.
**** update****
Try this solution :-
or you can introduce a variable to handle segue in viewWillAppear.
PUT
change the fromCamera = true, in prepareForSegue
AND use like this