Here is how to programatically change UITabBar Tint Color, UITabBar Item Tint Color & also how to change UITabBar Item’s unselected icon tint color.

Assumption: I assume you have deployed UITabBarViewController in your iOS App. And now you want to change UITabBar Tint color, UITabBar Item’s Tint color and also UITabBar’s unselected icon’s tint color.

 
Do this is just simple as single line of code.

 
Below code will go to your Apple iOS app’s AppDelegate.swift file under ‘didFinishLaunchingWithOptions’ function.

 
So your code will look something like this.

 

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
UITabBar.appearance().tintColor = UIColor(red: 0/255, green: 0/255, blue: 255/255, alpha: 1.0)
UITabBar.appearance().barTintColor = UIColor(red: 0/255, green: 0/255, blue: 0/255, alpha: 1.0)
UITabBar.appearance().unselectedItemTintColor = UIColor(red: 0/255, green: 255/255, blue: 0/255, alpha: 1.0)
}

 
Hope it helps,

 
Thanks & Regards
Mandar Apte

Mandar Apte

This website contains a design articles blog by Mandar Apte. He writes and shares his iOS development, graphic, web, & animation film design experience through articles. Mandar is Mumbai based multi-disciplinary designer with expertise in UI, UX, Logo, Symbol, and Brand Identity design. He is an alumnus of Sir J. J. Institute of Applied Art, Mumbai. He currently runs his studio in the heart of the city of Mumbai.

Leave a Reply

Your email address will not be published. Required fields are marked *