Pixate / pixate-freestyle-ios

Pixate Freestyle for iOS
Apache License 2.0
849 stars 134 forks source link

UITabBarItem Font Not working in iOS 8.3 #176

Open cliftonlabrum opened 9 years ago

cliftonlabrum commented 9 years ago

--- blows dust off Pixate Freestyle --- ;)

Setting the font of a tab bar item no longer works in Pixate as of iOS 8.3 and Xcode 6.3:

tab-bar-item {
  color: #696D72;
  font-family: "Avenir Next";
  font-weight:600;
  font-size:12px;
}

This is likely caused by the fact that the UIFont has to be force unwrapped. Doing this with UIAppearance used to be this:

UITabBarItem.appearance().setTitleTextAttributes([NSFontAttributeName: UIFont(name: "AvenirNextCondensed-DemiBold", size:12)], forState:.Normal)

...but now must be this:

UITabBarItem.appearance().setTitleTextAttributes([NSFontAttributeName: UIFont(name: "AvenirNextCondensed-DemiBold", size:12)!], forState:.Normal)

Note the ! after UIFont(...) There's a chance this will start creeping up for all font usage in Pixate.