How to disable UITextField's edit property?

Solutions Collect From Internet About “How to disable UITextField's edit property?”

To disable editing in UITextField you need to return NO in delegate method textFieldShouldBeginEditing:

- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField{
    return NO;
}

To disable editing in UITextView set property editable to NO:

[textView setEditable:NO];