Contents

textColor

The color of the text.

Declaration

var textColor: UIColor! { get set }

Discussion

If you’re using styled text, assigning a new value to this property applies the color 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 aren’t using styled text, this property applies to the entire text string in the text property.

The default value for this property is the system’s label color, which adapts dynamically to Dark Mode changes. Setting this property to nil causes it to be reset to the default value. For more information, see UI element colors.

See Also

Accessing the text attributes