In my application, I have a text box that is very small. I want to highlight the text in it as soon as the user touches it, and then, having typed the next character, the previous text (highlighted by the tap) will disappear, and the newly entered data will replace it.
I tried with the following code:
UITextField *aTextField = [[UITextField alloc] initWithFrame:myFrame];
aTextField.clearButtonMode = UITextFieldViewModeWhileEditing;
But since the text field is very small, this does not suit here. I want the text to light up when pressed without any control, and then when I click the next character, I will replace the selected text. Any idea how to do this.
source
share