Instance Property

allowsEditingTextAttributes

A Boolean value indicating whether the user may edit the attributes of the text in the text field.

Declaration

var allowsEditingTextAttributes: Bool { get set }

Discussion

If this property is set to true, the user may edit the style information of the text. In addition, pasting styled text into the text field retains any embedded style information. If false, the text field prohibits the editing of style information and strips style information from any pasted text. However, you can still set the style information programmatically using the methods of this class.

The default value of this property is false.

See Also

Managing the Editing Behavior

var isEditing: Bool

A Boolean value indicating whether the text field is currently in edit mode.

var clearsOnBeginEditing: Bool

A Boolean value indicating whether the text field removes old text when editing begins.

var clearsOnInsertion: Bool

A Boolean value indicating whether inserting text replaces the previous contents.

enum UITextField.DidEndEditingReason

Constants indicating the reason why editing ended in a text field.

class let textDidBeginEditingNotification: NSNotification.Name

Notifies observers that an editing session began in a text field. The affected text field is stored in the object parameter of the notification. The userInfo dictionary is not used.

class let textDidChangeNotification: NSNotification.Name

Notifies observers that the text in a text field changed. The affected text field is stored in the object parameter of the notification.

class let textDidEndEditingNotification: NSNotification.Name

Notifies observers that the editing session ended for a text field. The affected text field is stored in the object parameter of the notification. The userInfo dictionary is not used.