Klas Zetterlund Klas Zetterlund - 5 months ago 19
iOS Question

Font lost when simulating on iPad

I have a label in my app that works in all screen sizes. The text uses a custom font. So far so good.

When I run the app on an iPad the text becomes too small so I created a font size that only applies to regular height regular width. This looks fine in the storyboard but when I simulate as an iPad it loses the font and size. This does not happened when I use another font.

I have cleared and restarted Xcode. I made sure the font is in

and that the project is selected in Target membership.

What could be wrong?


Choose System Font in storyboard for size classes. Change your Font in code.

enter image description here

self.yourLabel.font = [UIFont fontWithName:@"Custom regular Font" size:self.yourLabel.font.pointSize];

This is sort of a bug in size classes.