UIFont class provides the interface for getting and setting font information. The class provides you with access to the font’s characteristics and also provides the system with access to the font’s glyph information, which is used during layout. You use font objects by passing them to methods that accept them as a parameter.
- iOS 2.0+
- tvOS 9.0+
- watchOS 2.0+
You do not create
UIFont objects using the
init methods. Instead, you use class methods of
UIFont, such as
preferred, 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.
Font objects are immutable and so it is safe to use them from multiple threads in your app.