Global Variable

NSFontAttributeName

Declaration

iOS, tvOS, watchOS
const NSAttributedStringKey NSFontAttributeName;
macOS
NSAttributedStringKey NSFontAttributeName;

Discussion

The value of this attribute is a UIFont object. Use this attribute to change the font for a range of text. If you do not specify this attribute, the string uses a 12-point Helvetica(Neue) font by default.