After having a look at this good tutorial, i’ve noticed that some code has been declared deprecated in iOS 7.0+:
Old code (deprecated, but still works)
[[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: [UIColor whiteColor], UITextAttributeTextColor, nil] forState:UIControlStateNormal]; [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: [UIColor redColor], UITextAttributeTextColor, nil] forState:UIControlStateHighlighted];
The most elegant solution for that is using NSForegroundColorAttributeName, and UIControlStateHighlighted.
iOS 7.0+ version of the previous code
[[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: [UIColor blueColor], NSForegroundColorAttributeName, nil] forState:UIControlStateNormal]; [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor redColor], NSForegroundColorAttributeName, nil] forState:UIControlStateSelected];
It may seem too silly, but believe me, it wasn’t that easy to find the right solution between that many incorrect answers that still use UITextAttributeTextColor, which is deprecated.
Happy coding!