NSParagraphStyle

extension NSParagraphStyle
  • Combines line spacing with the existing style

    Declaration

    Swift

    public func styleWithLineSpacing(_ lineSpacing: CGFloat) -> NSParagraphStyle

    Parameters

    lineSpacing

    the line spacing to use

    Return Value

    Current paragraph style combined with line spacing

  • Combines line height multiple with the existing style

    Declaration

    Swift

    public func styleWithLineHeightMultiple(_ lineHeightMultiple: CGFloat) -> NSParagraphStyle

    Parameters

    lineHeightMultiple

    the line height multiple to use

    Return Value

    Current paragraph style combined with line height multiple

  • Combines text alignment with the existing style

    Declaration

    Swift

    public func styleWithAlignment(_ alignment: NSTextAlignment) -> NSParagraphStyle

    Parameters

    alignment

    the text alignment to use

    Return Value

    Current paragraph style combined with text alignment

  • Combines line height with the existing style

    Declaration

    Swift

    public func styleWithLineHeight(
        _ lineHeight: CGFloat,
        indent: CGFloat = 0,
        spacing: CGFloat = 0
    ) -> NSParagraphStyle

    Parameters

    lineHeight

    the line height to use

    indent

    the indent to use (ignored if 0)

    spacing

    the spacing to use (ignored if 0)

    Return Value

    Current paragraph style combined with line height and (if non-zero) indent and spacing