Instance Property

textColor

The color of the text.

Declaration

var textColor: UIColor? { get set }

Discussion

This property applies to the entire text string. The default text color is black.

In iOS 6 and later, assigning a new value to this property causes the new text color to be applied to the entire contents of the text view. If you want to apply the color to only a portion of the text, you must create a new attributed string with the desired style information and assign it to the attributedText property.

See Also

Configuring the Text Attributes

var text: String!

The text displayed by the text view.

var attributedText: NSAttributedString!

The styled text displayed by the text view.

var font: UIFont?

The font of the text.

var isEditable: Bool

A Boolean value indicating whether the receiver is editable.

var allowsEditingTextAttributes: Bool

A Boolean value indicating whether the text view allows the user to edit style information.

var dataDetectorTypes: UIDataDetectorTypes

The types of data converted to tappable URLs in the text view.

var textAlignment: NSTextAlignment

The technique to use for aligning the text.

var typingAttributes: [NSAttributedString.Key : Any]

The attributes to apply to new text being entered by the user.

var textContainerInset: UIEdgeInsets

The inset of the text container's layout area within the text view's content area.