Instance Property

typingAttributes

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

Declaration

var typingAttributes: [NSAttributedString.Key : Any]? { get set }

Discussion

This dictionary contains the attribute keys (and corresponding values) to apply to newly typed text. When the text field’s selection changes, the contents of the dictionary are cleared automatically.

If the text field is not in editing mode, this property contains the value nil. Similarly, you cannot assign a value to this property unless the text field is currently in editing mode.

See Also

Accessing the Text Attributes

var text: String?

The text displayed by the text field.

var attributedText: NSAttributedString?

The styled text displayed by the text field.

var placeholder: String?

The string that is displayed when there is no other text in the text field.

var attributedPlaceholder: NSAttributedString?

The styled string that is displayed when there is no other text in the text field.

var defaultTextAttributes: [NSAttributedString.Key : Any]

The default attributes to apply to the text.

var font: UIFont?

The font of the text.

var textColor: UIColor?

The color of the text.

var textAlignment: NSTextAlignment

The technique to use for aligning the text.

enum UITextField.BorderStyle

The type of border drawn around the text field.