Setting the default tab when using storyboards

前端 未结 12 932
执笔经年
执笔经年 2020-12-12 16:27

Can anyone please tell me how to set the default tab when using storyboards in iOS. I can\'t seem to figure out how to accomplish this.

Thank you

12条回答
  •  眼角桃花
    2020-12-12 16:56

    The following code worked for me:

    UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;
    tabBarController.selectedIndex = 2;
    

提交回复
热议问题