I wonder if someone knows how to change the color of the items in the tab bar in ios 9, now with the following code only the selected one is marked.
UITabBar.appearance().tintColor = UIColor.whiteColor()
I found a way to solve this and I publish it in case someone is interested. Change the color of the original images to the color that I would like them to have without being selected. Then I did the following:
I added this code to color the text in both selected and unselected.
UITabBarItem.appearance (). setTitleTextAttributes ([NSForegroundColorAttributeName: UIColor.blackColor ()], forState: .Normal) UITabBarItem.appearance (). SetTitleTextAttributes ([NSForegroundColorAttributeName: UIColor.whiteColor ()], forState: .Selected)
In each View controller, indicate the image of your tab item in both selected and unselected, also indicating the rendering of the image (there lies the trick so that the icon dyes the selected color)
self.tabBarItem.selectedImage = UIImage(named: "home")?.imageWithRenderingMode(.AlwaysTemplate) self.tabBarItem.image = UIImage(named: "home")?.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal)
And of course I added the line of code in the Appdelegate with which I started the question.
UITabBar.appearance (). tintColor = UIColor.whiteColor ()