Reputation: 2348
I have project with splitViewController as on image (iPhone version).
On masterVC I have tableVC, on detailVC I have some information about items from masterVC. On detail VC I have a button. After touching this button I need go back to master view. If I do something like:
_ = navigationController?.popToRootViewController(animated: true)
It has no affect. How to go back on masterVC?
Upvotes: 1
Views: 1442
Reputation: 71047
Calling popToRootViewController:
in the detail viewcontroller will call it on the detailvc's navigation controller.
On the iPhone (assuming there's no split screen), if you want to dismiss the detail controller and go back to the master, you can do this
detailVC.navigationController?.navigationController?.popToRootViewController(animated: true)
Upvotes: 4