UIFont
An object that provides access to the font’s characteristics.
Declaration
class UIFontMentioned in
Overview
Use UIFont to access your font’s characteristics within your app. It also provides the system with access to the glyph information, used during layout. Font objects are immutable, so it’s safe to use them from multiple threads in your app.
In Objective-C, don’t create font objects using the alloc and init methods. Instead, use class methods of UIFont, such as preferredFont(forTextStyle:), to look up and retrieve the desired font object. These methods check for an existing font object with the specified characteristics and return it if it exists. Otherwise, they create a new font object based on the desired font characteristics.
Topics
Creating Fonts
Scaling fonts automaticallyCreating self-sizing table view cellspreferredFont(forTextStyle:)preferredFont(forTextStyle:compatibleWith:)UIFont.TextStyleinit(name:size:)init(descriptor:size:)withSize(_:)
Creating System Fonts
systemFont(ofSize:)systemFont(ofSize:weight:)UIFont.WeightsystemFont(ofSize:weight:width:)UIFont.WidthboldSystemFont(ofSize:)italicSystemFont(ofSize:)monospacedSystemFont(ofSize:weight:)monospacedDigitSystemFont(ofSize:weight:)