Ios – How to change tab bar item text color

iosios7iphoneobjective c

enter image description here

How can I change the color of "More.." text in tabbar to match with its icon color. (Right now Performance is selected in the tab bar)

I tried to set TitleTextAttributes.

[moreItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont fontWithName:@"HelveticaLTStd-Roman" size:10.0f], NSFontAttributeName,  [UIColor yellowColor],NSForegroundColorAttributeName , nil]

But it the text color is always set to yellow. even when the item is selected. Like this
enter image description here

I am trying set to white when selected and when unselected it should match with icon color.
Thanks..
Any suggestions will be really helpful.

Best Answer

The accepted answer's code not work for me.

Here is code, that works:

    [[UITabBarItem appearance] setTitleTextAttributes:@{ NSForegroundColorAttributeName : [UIColor yellowColor] }
                                             forState:UIControlStateNormal];
    [[UITabBarItem appearance] setTitleTextAttributes:@{ NSForegroundColorAttributeName : [UIColor whiteColor] }
                                             forState:UIControlStateSelected];