Swift: Change the image tint color of tab bar?

Rahul Sonvane picture Rahul Sonvane · May 1, 2015 · Viewed 16.1k times · Source

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?

Answer

Satachito picture Satachito · May 1, 2015

In your 'application:didFinishLaunchingWithOptions'

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

or use appearance delegate.

UITabBar.appearance().tintColor = UIColor.red