UILabel

public extension UILabel
  • fontTextStyle is intended to be used instead of setting the font style by taking advantage of UIFont.preferredFont(forTextStyle:) to manage your apps fonts.

    When the style is set, the corresponding font will be set. If the font is changed, then the label will have no specific font text style.

    Warning

    Setting this property may arise a runtime error if the font name returned by UIFont.appFontName(for:) is not valid.

    Warning

    To avoid memory leak and crashes, you should set the fontTextStyle to .none before deallocating the label.

    Seealso

    UIFont.appFontName(for:).

    Declaration

    Swift

    var fontTextStyle: UIFont.TextStyle? { get set }