Change tab bar item selected color in a storyboard
I want to change my tab bar items to be pink when selected instead of the default blue.
How can i accomplish this using the storyboard editor in Xcode 6?
Here are my current setting which are not working, the blue background works but the pink doesnt work:
Solution 1:
Add Runtime Color attribute named "tintColor" from StoryBoard. This is working(for Xcode 8 and above).
if you want unselected color.. you can add unselectedItemTintColor
too.
Solution 2:
This elegant solution works great on SWIFT 3.0, SWIFT 4.2 and SWIFT 5.1:
On the Storyboard:
- Select your Tab Bar
- Set a Runtime Attibute called tintColor for the desired color of the Selected Icon on the tab bar
- Set a Runtime Attibute called unselectedItemTintColor for the desired color of the Unselected Icon on the tab bar
Edit: Working with Xcode 8/10, for iOS 10/12 and above.