UIFont

extension UIFont
  • Get Fiori preferred font based on a given UIFontTextStyle. This is a scaled font.

    Supported attributes: Regular, Italic, Light, Bold, BoldItalic, Black, Condensed, CondensedBold.

    Declaration

    Swift

    public class func preferredFioriFont(forTextStyle textStyle: UIFontTextStyle, weight: UIFont.Weight = .regular, isItalic: Bool = false, isCondensed: Bool = false) -> UIFont

    Parameters

    textStyle

    The UIFontTextStyle text style

    weight

    The weight of the font.

    isItalic

    The italic version of the font.

    isConsensed

    The condensed version of the font.

    Return Value

    The font object with specified attributes.

  • Get Fiori preferred font with a given size. Not a scaled font.

    Supported attributes: Regular, Italic, Light, Bold, BoldItalic, Black, Condensed, CondensedBold.

    Declaration

    Swift

    public class func preferredFioriFont(fixedSize size: CGFloat, weight: UIFont.Weight = .regular, isItalic: Bool = false, isCondensed: Bool = false) -> UIFont

    Parameters

    textStyle

    The UIFontTextStyle text style

    weight

    The weight of the font.

    isItalic

    The italic version of the font.

    isConsensed

    The condensed version of the font.

    Return Value

    The font object with fixed size.

  • Register Fiori fonts in the app.

    Call UIFont.registerFioriFonts() in AppDelegate to load all the fiori fonts into your app. If it is not called, UIFont.preferredFioriFont(forTextStyle:) will return system font instead.

    Declaration

    Swift

    public static func registerFioriFonts()
  • Declaration

    Swift

    extension UIFont.TextStyle
    extension UIFont.TextStyle: CustomStringConvertible
    extension UIFont.TextStyle: CaseIterable
  • Declaration

    Swift

    extension UIFont.Weight: CaseIterable, CustomStringConvertible