cubiclewar cubiclewar - 3 months ago 7x
Objective-C Question

Non-editable UITextField with copy menu

Is there a way to make a UITextField non-editable by the user and provide only a copy menu without subclassing? I.e when the text field is touched it automatically selects all the text and only shows the copy menu.

If possible to do this without subclassing what are the interface builder options that need to be selected?

Thanks in advance.


you could disable by assigning NO in enabled variable of UITextField.

textField.enabled = NO;

But disabling textField also disabled the copy/paste options, The same which you ask have discussed before here see SO solution below

Enable copy and paste on UITextField without making it editable