Xcode 6 has a new feature where fonts and font sizes in UILabel
, UITextField
, and UIButton
can be s
I've come up with even faster fix (I assume you always use your one custom font).
Create a category for UILabel and include in files using buggy storyboard with size classes and dedicated font setting for various classes:
@implementation UILabel (FontFixForSizeClassesAppleBug)
- (void)layoutSubviews
{
[super layoutSubviews];
if([[UIFont systemFontOfSize:10].familyName isEqualToString:self.font.familyName]) {
//workaround for interface builder size classes bug which ignores custom font if various classes defined for label: http://stackoverflow.com/questions/26166737/custom-font-sizing-in-xcode6-size-classes-not-working-properly-w-custom-fonts
self.font = [UIFont fontWithName:@"YOUR_CUSTOM_FONT_NAME" size:self.font.pointSize];
}
}
@end
Just use your custom fonts in storyboard. When buggy interpreter will use system font instead your own this category will switch it to your custom font.