Instance Property

textColor

The color of the text.

Declaration

var textColor: UIColor! { get set }

Discussion

If you are using styled text, assigning a new value to this property causes the color to be applied to the entirety of the string in the attributedText property. If you want to apply the color to only a portion of the text, create a new attributed string with the desired style information and associate it with the label. If you are not using styled text, this property applies to the entire text string in the text property.

The default value for this property is a black color (set through the black class property of UIColor). Setting this property to nil causes it to be reset to the default value.

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 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.