Instance Property


The technique to use for wrapping and truncating the label’s text.


var lineBreakMode: NSLineBreakMode { get set }


If you are not using styled text, this property applies to the entire text string in the text property. If you are using styled text, assigning a new value to this property causes the line break mode to be applied to the entirety of the string in the attributedText property. If you want to apply the line break mode to only a portion of the text, create a new attributed string with the desired style information and associate it with the label. However, NSParagraphStyle properties, such as those defined by NSLineBreakMode, apply to entire paragraphs (as defined for paragraphRange(for:)), not words within paragraphs.This property is in effect both during normal drawing and in cases where the font size must be reduced to fit the label’s text in its bounding box. This property is set to NSLineBreakMode.byTruncatingTail by default.

See Also

Accessing the Text Attributes

var text: String?

The current text that is displayed by the label.

var attributedText: NSAttributedString?

The current styled text that is displayed by the label.

var font: UIFont!

The font used to display the text.

var textColor: UIColor!

The color of the text.

var textAlignment: NSTextAlignment

The technique to use for aligning the text.

var isEnabled: Bool

The enabled state to use when drawing the label’s text.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software