NSAttributedString

extension NSAttributedString

This extension allows us to get the displayed height and width (given a full-sized canvas -so no wrapping or truncating) of an attributed string.

  • Declaration

    Swift

    var stringHeight: CGFloat { get }

    Return Value

    The string height required to display the string.

  • Declaration

    Swift

    var stringWidth: CGFloat { get }

    Return Value

    The string width required to display the string.