Is there a way to pop a view controller when the user switches tabs?
-
13-09-2019 - |
Question
Is there a way to pop the view controller when the user switches tabs?
I have a tabbar with a navigationController on one of the tabs. The user selects a row in a table which pushes a viewController onto the navigationController containing the table. Then the user switches tabs to a new view. In the new view he hits a button that brings him back to the table tab. The problem is that the table inside the navigationController still has a view pushed onto it.
Solution
Take a look at the UITabBarControllerDelegate in your situation you could call:
[navigationController popToRootViewControllerAnimated:NO];
when the tabbarcontroller calls it's didSelectViewController
delegate method
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow