Instance Property


The amount by which text is inset within line fragment rectangles.


var lineFragmentPadding: CGFloat { get set }


The padding appears at the beginning and end of the line fragment rectangles. The layout manager uses this value to determine the layout width. The default value of this property is 5.0.

Line fragment padding is not designed to express text margins. Instead, you should use insets on your text view, adjust the paragraph margin attributes, or change the position of the text view within its superview.

See Also

Constraining Text Layout

var maximumNumberOfLines: Int

The maximum number of lines that can be stored in the text container.

func lineFragmentRect(forProposedRect: CGRect, at: Int, writingDirection: NSWritingDirection, remaining: UnsafeMutablePointer<CGRect>?)

Returns the bounds of a line fragment rectangle inside the receiver for the proposed rectangle.

var isSimpleRectangularTextContainer: Bool

A boolean that indicates whether the receiver’s region is a rectangle with no holes or gaps and whose edges are parallel to the text view's coordinate system axes.