I am trying to change my text UITabBarItemsand have used questions like this . The second answer is great for me if I don't try to customize the font UITabBarItem. This fragment displays the expected results of the selected white text, and the unselected element is light gray:
UITabBarItem.appearance().setTitleTextAttributes([NSForegroundColorAttributeName: UIColor.blackColor()], forState:.Normal)
UITabBarItem.appearance().setTitleTextAttributes([NSForegroundColorAttributeName: UIColor.whiteColor()], forState:.Selected)

However, if this is added:
UITabBarItem.appearance().setTitleTextAttributes([NSFontAttributeName:UIFont(name: "American Typewriter", size: 13)!], forState: .Selected)

For some reason, the text turns black when it is selected and not selected, and the font remains unchanged.
Oddly enough, if I changed .Selectedto .Normalin the last fragment, then the selected text will turn white and the text will be executed in accordance with the font in the code.

UITabBarItem.appearance().setTitleTextAttributes([NSFontAttributeName:UIFont(name: "American Typewriter", size: 13)!], forState: .Normal)
, . , - , - , .
dfri, :
UITabBarItem.appearance().setTitleTextAttributes([NSForegroundColorAttributeName: UIColor.blackColor(),
NSFontAttributeName : [NSFontAttributeName:UIFont(name: "American Typewriter", size: 13)!]], forState:.Selected)
UITabBarItem.appearance().setTitleTextAttributes([NSForegroundColorAttributeName : UIColor.whiteColor(),
NSFontAttributeName : [NSFontAttributeName:UIFont(name: "American Typewriter", size: 13)!]], forState:.Normal)
. :
, 0x7fa6d9461ef0