How can I use the dynamic type text style \"Title 1\" and set the font face to the built-in font Chalkboard SE for a UILabel in a storyboard?
I need to honor the Dynamic
Although you can't specify both a custom font and a preferred text style via Storyboard, it's not difficult to programmatically specify a dynamic type size for your custom font:
Swift:
let pointSize = UIFontDescriptor.preferredFontDescriptorWithTextStyle(UIFontTextStyleTitle1).pointSize
let customFont = UIFont(name: "Chalkboard SE", size: pointSize)
When you receive a UIContentSizeCategoryDidChangeNotification
, use the same code to update your label's font.
Obj C:
CGFloat pointSize = [[UIFontDescriptor preferredFontDescriptorWithTextStyle:UIFontTextStyleHeadline] pointSize];
[titleLabel setFont:[UIFont fontWithName:@"Marker Felt" size:pointSize]];