Modify (Storyboard)TabBarController tabs before th

2019-08-29 04:23发布

So my app decides at runtime which TabBarItems are available. Problem is, [self.tabBarController viewControllers] is empty in the actual TabBarController class (in viewDidLoad and viewWillAppear that is). It is filled after the first ViewController (tab) did load, but that is too late as i dont even know if i want to load this particular one.

I know this can be solved by dumping storyboard, is it possible relying on it too?

Best solution that comes to mind so far is creating a dummy ViewController that gets swapped out immediately after loading is done...

1条回答
干净又极端
2楼-- · 2019-08-29 04:23

It's empty because the tab bar controller doesn't have a tabBarController property. It should just be self.viewControllers.

查看更多
登录 后发表回答