TextStyle

Collection of all TextStyle Extensions.

Subspec: Extensions/TextStyleExtension

  • Return a TextStyle that’s identical to the called except the color set to the given UIColor.

    Declaration

    Swift

    func withColor(_ color: UIColor) -> TextStyle

    Parameters

    color

    The color that’s applied to the TextStyle.

    Return Value

    TextStyle that has custom color being applied.

  • Return a TextStyle that’s identical to the called except the text allignment is set to the given allignment.

    Declaration

    Swift

    func withAlignment(_ allignment: NSTextAlignment) -> TextStyle

    Parameters

    allignment

    NSTextAlignment.

    Return Value

    Updated text style.

  • Return a TextStyle that’s identical to the called except the text line spacing is set to the given line spacing.

    Declaration

    Swift

    func withLineSpacing(_ lineSpacing: CGFloat) -> TextStyle

    Parameters

    lineSpacing

    CGFloat.

    Return Value

    TextStyle.

  • Returns textstyle with its em font as default font.

    Declaration

    Swift

    func withEmFont() -> TextStyle

    Return Value

    Textstyle with em font selected.

  • Returns textstyle with its strong font as default font.

    Declaration

    Swift

    func withStrongFont() -> TextStyle

    Return Value

    Textstyle with strong font selected.

  • This attempts to build a regular font verson of this font by getting the family name.

    Declaration

    Swift

    func withRegularFont() -> TextStyle

    Return Value

    The font you’ve built but with a regular typeface.

  • Returns new text style given a minimum line height.

    Declaration

    Swift

    func withMinLineHeight(_ minimumLineHeight: CGFloat) -> TextStyle

    Parameters

    minimumLineHeight

    Minimum line height.

  • Returns new text style given value for character spacing.

    Declaration

    Swift

    func withCharacterSpacing(_ spacing: CGFloat) -> TextStyle

    Parameters

    spacing

    character spacing.

  • Returns new text style given a line break mode.

    Declaration

    Swift

    func withLineBreakMode(_ lineBreakMode: LineBreakMode) -> TextStyle

    Parameters

    lineBreakMode

    Line break mode.

    Return Value

    TextStyle.