self.navigationController.tabBarController.selectedIndex not working

前端 未结 7 2092
野趣味
野趣味 2021-01-14 02:07

I have a UITabBarController which containing 4 different UIViewControllers.

On first tab there is a UINavigationViewController

7条回答
  •  孤独总比滥情好
    2021-01-14 02:58

    for calling the tabbarcontroller.selectedindexyou must have to find out the tabbarcontroller from the navigation controller if you dont use push on navigationController just use topViewController property of navigationController to get the instance of your tabBarController and assign it to UITabBarController and us the selectedIndex and this will work fine

提交回复
热议问题