Reputation: 2501
i am developing a Swift iOS8 app for iPad & iPhone using autolayout.
I am using a Custom Font (OpenSans) for my UILabels.
When i declare specific font sizes for specific size classes (e.g. Regular Height, Compact Width) in the storyboard, the resulting font sizes look fine on the iPhone but on the iPad they always have the same small font-size as on the iPhone instead of the font-size i specified.
If i change the font of all UILabels back to the system font instead of my custom font, the font sizes are correct.
So it seems to be an issue with my custom font.
Anyone has a clue why this is happening?
Upvotes: 1
Views: 1809
Reputation: 4270
This is a size class bug. Custom fonts do not work with size classes. The best approach I've found is to use a UILabel subclass to replace the font and use the system fonts in IB.
Check out this answer for possible solutions: Custom Font Sizing in XCode6 Size Classes Not Working Properly w/ Custom Fonts
Note: I'm away from my computer right now but I'll post some sample code when I get back.
Upvotes: 3