Pregunta

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?

¿Fue útil?

Solución

Use this in App delegate didFinishLaunchingWithOptions method for selecting particular tab index.

UITabBarController *tabController = (UITabBarController*)self.window.rootViewController;
tabController.selectedIndex = selectedTabIndex;
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top