Use this in App delegate didFinishLaunchingWithOptions
method for selecting particular tab index.
UITabBarController *tabController = (UITabBarController*)self.window.rootViewController;
tabController.selectedIndex = selectedTabIndex;
Question
In my app I usually want to start the user in the first tab bar (as set up in Storyboard). However depending on certain settings, I want to select another tab whenever the app is loaded or just enters the foreground again. How can I do this in the app delegate?
Solution
Use this in App delegate didFinishLaunchingWithOptions
method for selecting particular tab index.
UITabBarController *tabController = (UITabBarController*)self.window.rootViewController;
tabController.selectedIndex = selectedTabIndex;