Instance Method


Enables or disables the text field.


func setEnabled(_ enabled: Bool)



A Boolean value indicating whether the text field is enabled or disabled.


The enabled value determines whether the text field responds to user interaction. For enabled text fields, tapping the text field starts the text entry process. On watchOS, the system displays the text input controller. On nearby iOS devices associated with the same iCloud account, the system displays the Apple Remote Keyboard. A disabled text field does not respond to taps.

See Also

Configuring the Control

func setSecureTextEntry(Bool)

Determines whether the text field hides the text entered by the user.