Вопрос

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?

Это было полезно?

Решение

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

UITabBarController *tabController = (UITabBarController*)self.window.rootViewController;
tabController.selectedIndex = selectedTabIndex;
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top