NSParagraphStyle

class NSParagraphStyle

The paragraph or ruler attributes used by an attributed string.

  • The distance in points between the bottom of one line and the top of the next.

    Declaration

    var lineSpacing: Double { get }
  • The distance in points between the last line of a paragraph to the first line of the next.

    Declaration

    var paragraphSpacing: Double { get }
  • The text alignment.

    Declaration

    var alignment: String { get }
  • The distance in points from the leading margin of the text container to the beginning of lines other than the first. This value is always nonnegative.

    Declaration

    var headIndent: Double { get }
  • The trailing indentation. If positive, this value is the distance from the leading margin (for example, the left margin in left-to-right text). If 0 or negative, it’s the distance from the trailing margin. For example, a paragraph style designed to fit exactly in a 2-inch wide container has a head indent of 0.0 and a tail indent of 0.0. One designed to fit with a quarter-inch margin has a head indent of 0.25 and a tail indent of –0.25.

    Declaration

    var tailIndent: Double { get }
  • The indentation of the first line.

    Declaration

    var firstLineHeadIndent: Double { get }
  • Minimum allowable line height measured in points.

    Declaration

    var minimumLineHeight: Double { get }
  • Maximum allowable line height measured in points.

    Declaration

    var maximumLineHeight: Double { get }
  • The line break mode used to layout lines in paragraph.

    Declaration

    var lineBreakMode: Double { get }
  • The base writing direction of the text.

    Declaration

    var baseWritingDirection: Double { get }
  • The line height multiple. The natural line height of the is multiplied by this factor (if positive) before being constrained by minimum and maximum line height. The default value of this property is 0.0.

    Declaration

    var lineHeightMultiple: Double { get }
  • The distance between the paragraph’s top and the beginning of its text content.

    Declaration

    var paragraphSpacingBefore: Double { get }
  • The paragraph’s threshold for hyphenation.

    Declaration

    var hyphenationFactor: Double { get }
  • An array of NSTextTab objects representing the receiver’s tab stops.

    Declaration

    var tabStops: Array<NSTextTab> { get }
  • Default tab stop interval.

    Declaration

    var defaultTabInterval: Double { get }
  • A value indicating whether the system may tighten inter-character spacing before truncating text.

    Declaration

    var allowsDefaultTighteningForTruncation: Bool { get }
  • The threshold for using tightening as an alternative to truncation.

    Declaration

    var tighteningFactorForTruncation: Double { get }
  • An array specifying the text blocks containing the paragraph.

    Declaration

    var textBlocks: Array<NSTextBlock> { get }
  • An array specifying the text lists containing the paragraph.

    Declaration

    var textLists: Array<NSTextList> { get }
  • A Boolean that specifies whether the paragraph is to be treated as a header for purposes of HTML generation.

    Declaration

    var headerLevel: Double { get }
  • The object’s description

    Declaration

    var description: String { get }
  • Compares two values for equality.

    The equals function is invoked using infix notation as in the following code snippet: lhs == rhs.

    Declaration

    func equals(_ lhs: NSAttributedString) -> Bool

    Parameters

    lhs

    A value.

    rhs

    Another value.

    Return Value

    true if the lhs and rhs are equal, false otherwise.