Setup MoreViewController

#1
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:
Mã:
let tabController = UITabBarController()
and in my
didFinishLaunchingWithOptions
I do:
Mã:
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?

Help!
 

Admin

Administrator
Thành viên BQT
#2
Since your edits are in
Mã:
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
Mã:
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.

Top