Setup MoreViewController

OK, I'm a sinner. The good news is: I use multiple Storyboards (yay!) The bad news: I'm not inspired enough to escape the 'More..' tab.

Now: I need to make the moreviewcontroller to look like the rest of my app.

So, in my
I do:
let tabController = UITabBarController()
and in my
I do:
self.tabController.moreNavigationController.topViewController?.view.tintColor = .red
self.tabController.moreNavigationController.navigationBar.topItem?.title = "MyString"
self.tabController.moreNavigationController.navigationBar.tintColor = .red
When I launch my app, none of the above is visible, nor is any error logged in the console

My assumption is, that I refer to the wrong tabbarcontroller, and maybe that could be explained by the fact that I have multiple Storyboards?



Thành viên BQT
Since your edits are in
let tabController = UITabBarController()
that has no relation to the real tab then it's on the fly so you need to either init it then assign it to the window root or if you use storyboard access it with
if let tab = self.window?.rootViewController as? UITabBarController {
  // do whatever you want

Từ khóa phổ biến

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.