UIFontMetrics
A utility object for obtaining custom fonts that scale to support Dynamic Type.
Declaration
class UIFontMetricsMentioned in
Overview
Use a UIFontMetrics object to support scalable custom fonts in your app. You create a font metrics object that specifies the font style—for example, body or title—that you want to use in your app. You then pass your custom font to the scaledFont(for:) method (or one of the other methods of this class) to obtain a font object that is based on your custom font, has the appropriate style information, and automatically scales to match the current Dynamic Type settings.
Topics
Creating a Font Metrics Object
Creating Scaled Fonts
Scaling fonts automaticallyscaledFont(for:)scaledFont(for:compatibleWith:)scaledFont(for:maximumPointSize:)scaledFont(for:maximumPointSize:compatibleWith:)