質問

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