0
votes

I have a UITabbarController with 2 tab bar items. Each tab bar item contains several UIViewControllers linked with a UINavigationController. I want that each time I switch tab item, the view displayed is the root. How can I do?

1

1 Answers

0
votes

You may use UITabBarControllerDelegate's method tabBarController:shouldSelectViewController: to track user changing tabs, and perform popToRootViewController: on your navigation controller being selected there.

Another rather quirky solution may involve subclassing UINavigationController and doing the same thing in viewWillAppear:.