IOS: disabled UItextfield

When we click on a text field, the cursor appears in this text field; but I do not want this cursor to appear; then I want to disable this text box where you cannot write inside, how can I do this?

+6
source share
2 answers

Can you set the included property / userInteractionEnabled from the text field to No in ViewDidLoad () using code

textField.enabled = NO; 

or

 textField.userInteractionEnabled = NO; 
+15
source

If you are working with puff files or .nib files and you want it to be disabled, you can also easily disable the included property in the interface builder for a while.

+3
source

Source: https://habr.com/ru/post/887701/


All Articles