The NSParagraphStyle class and its subclass NSMutableParagraphStyle encapsulate the paragraph or ruler attributes used by the NSAttributedString classes. Instances of these classes are often referred to as paragraph style objects or, when no confusion will result, paragraph styles.


The mutable subclass of NSParagraphStyle is NSMutableParagraphStyle.

Nested Types


These constants specify what happens when a line is too long for its container.


These constants describe the various type of tab stop.


Creating an NSParagraphStyle

class var `default`: NSParagraphStyle

Returns the default paragraph style.

Accessing style information

var alignment: NSTextAlignment

The text alignment of the receiver.

var firstLineHeadIndent: CGFloat

The indentation of the first line of the receiver.

var headIndent: CGFloat

The indentation of the receiver’s lines other than the first.

var tailIndent: CGFloat

The trailing indentation of the receiver.

var lineHeightMultiple: CGFloat

The line height multiple.

var maximumLineHeight: CGFloat

The receiver’s maximum line height.

var minimumLineHeight: CGFloat

The receiver’s minimum height.

var lineSpacing: CGFloat

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

var paragraphSpacing: CGFloat

The space after the end of the paragraph.

var paragraphSpacingBefore: CGFloat

The distance between the paragraph’s top and the beginning of its text content.

Accessing Tab Information

var tabStops: [NSTextTab]

An array of NSTextTab objects representing the receiver’s tab stops.

var defaultTabInterval: CGFloat

The document-wide default tab interval.

Getting text block and list information

var textBlocks: [NSTextBlock]

An array specifying the text blocks containing the paragraph.

var textLists: [NSTextList]

An array specifying the text lists containing the paragraph.

Getting line breaking information

var lineBreakMode: NSLineBreakMode

The mode that should be used to break lines in the receiver.

var hyphenationFactor: Float

The paragraph’s threshold for hyphenation.

var tighteningFactorForTruncation: Float

The threshold for using tightening as an alternative to truncation.

Getting HTML header level

var headerLevel: Int

A boolean that specifies whether the paragraph is to be treated as a header for purposes of HTML generation.

Writing direction

class func defaultWritingDirection(forLanguage: String?)

Returns the default writing direction for the specified language.

var baseWritingDirection: NSWritingDirection

The base writing direction for the receiver.



These constants specify what happens when a line is too long for its container.