iosswiftuiimageuitabbarcontrollertintcolor

Swift: Change the image tint color of tab bar?


I have created the tabBarController programmatically and I want to change color of tint color of images (not the bar) that tab contains. Can anyone tell me how to do that in Swift?


Solution

  • In your 'application:didFinishLaunchingWithOptions'

    (window?.rootViewController as! UITabBarController).tabBar.tintColor = UIColor.red
    

    or use appearance delegate.

    UITabBar.appearance().tintColor = UIColor.red