How do I programmatically switch to another tab and go to the first view in the navigation stack ?
I can switch to a different tab.
self.tabBarController.selectedIndex = 4;
However, I also need to switch the a different view controller in the navigation stack of that tab.
How do I do that?
As soon as I run the code above, it switches, but to the currently loaded view controller in the navigation stack.
My view controllers are loaded into 5 navigation controllers which are added to the tab bar in app delegate.
I assume you have
UINavigationControllers in yourUITabBarController. If that’s the case you can usepopToRootViewControllerAnimated:to go to the first view controller.