Instance Property

text

The text displayed by the text view.

Declaration

var text: String! { get set }

Discussion

In iOS 6 and later, assigning a new value to this property also replaces the value of the attributedText property with the same text, albeit without any inherent style attributes. Instead the text view styles the new string using the font, textColor, and other style-related properties of the class.

See Also

Configuring the Text Attributes

var attributedText: NSAttributedString!

The styled text displayed by the text view.

var font: UIFont?

The font of the text.

var textColor: UIColor?

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