disable textfield editing without blocking the clear button

Viewed 475

do you know how I can make an edittext get non-editable for the user, but allow it to use the textfield's own clearbutton to delete it?

I tried using the:

textField.isEnabled = false

and

textField.isUserInteractionEnabled = false

but it did not work very well because it disables everything

1 Answers

Return false from the text field delegate’s textFieldShouldBeginEditing.

Related