cubiclewar cubiclewar - 1 year ago 136
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.

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download