UIFont

extension UIFont
  • Undocumented

    See more

    Declaration

    Swift

    public enum Extension
  • Registers a font for use in the app.

    Declaration

    Swift

    @discardableResult
    public static func register(name: String, fileExtension: Extension, in bundle: Bundle) -> Bool

    Parameters

    name

    The name of the font family.

    fileExtension

    The extension of the font file.

    bundle

    The bundle in which the font file is located.

    Return Value

    Returns true if registering font is successful.

  • Registers a font for use in the app.

    Declaration

    Swift

    @discardableResult
    public static func register(filePath: String) -> Bool

    Parameters

    filePath

    The file path of font.

    Return Value

    Returns true if registering a font is successful.

  • Gets a custom font after registering if needed.

    • ofSize: The size (in points) to which the font is scaled. This value must be greater than 0.0.

    Declaration

    Swift

    public static func customFont(filePath: String, ofSize fontSize: CGFloat) -> UIFont?

    Parameters

    filePath

    The file path of font.

    Return Value

    A font object of the specified font file path and size.