I am showing a UITextField to the user and the text inside this text field is updated by a different controller.
User cannot type inside this UITextField. I ensured this by doing the following:
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
return NO;
}
But I want to show the clear icon in the text field, so that the user can clear the value in textfield. I do that by doing the following:
_inputField.clearButtonMode = UITextFieldViewModeAlways;
But the clear button does not show up when there is a text inside it :(
Any idea what I might be doing wrong?