Instance Property


The styled text displayed in the label.


@NSCopying var attributedText: NSAttributedString? { get set }


This property is nil by default.

Assigning a new value to this property also replaces the value of the text property with the same string data, although without any formatting information. In addition, assigning a new value updates the values in the font, textColor, and other style-related properties so that they reflect the style information starting at location 0 in the attributed string.

Turn autokerning on for the label by setting the kern of the string to null.

See Also

Accessing the Text Attributes

var text: String?

The text that the label is displaying.

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 lineBreakMode: NSLineBreakMode

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

var isEnabled: Bool

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

var enablesMarqueeWhenAncestorFocused: Bool

A Boolean value that determines whether the label scrolls its text while one of its containing views has focus.