Type Method


Returns an instance of the system font for the specified text style, scaled for the user's selected content size category.


+ (UIFont *)preferredFontForTextStyle:(UIFontTextStyle)style;



The text style for which to return a font. See UIFontTextStyle for recognized values.

Return Value

The system font associated with the specified text style.


To create a styled font based on a custom font, use a UIFontMetrics object.

Because fonts are immutable, any element that adjusts for an updated content size category does not modify the font itself. Instead, the element replaces the assigned font with a new instance based on the original settings.

See Also

Creating Fonts

Scaling Fonts Automatically

Scale text in your interface automatically by using Dynamic Type.

Creating Self-Sizing Table View Cells

Create table view cells that support Dynamic Type and use system spacing constraints to adjust the spacing surrounding text labels.

+ preferredFontForTextStyle:compatibleWithTraitCollection:

Returns an instance of the system font for the appropriate text style and traits.

+ fontWithName:size:

Creates and returns a font object for the specified font name and size.

+ fontWithDescriptor:size:

Returns a font matching the given font descriptor.

- fontWithSize:

Returns a font object that is the same as the receiver but which has the specified size instead.