Daniel Storm Daniel Storm - 2 months ago 35
Swift Question

Globally change UINavigationBar bar tint color

Setting

UINavigationBar.appearance().tintColor
in
didFinishLaunchingWithOptions
used to change the
tintColor
across the entire application. On iOS 10, this is not the case anymore.

private func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Set tint color
UINavigationBar.appearance().tintColor = UIColor.black

return true
}


How can I change the navigation bar tint color?

Answer

The problem is your didFinishLaunchingWithOptions method. It was changed in iOS 10.

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool
Comments