ios - What does clear button set UITextField to? -
I have a piece of code that is responding to the text field. I want to see when If I What does the explicit button set the Maybe me just thanks ! . The text of the field is empty (either bypassed all the way or cleaned with a small round x button on the right).
.text == @ "
my code works, the user provides backspace. This does not work if the user has used a clear button. .text
of the text field? (I have logged it out and if I print it between two other characters, I see the blank.) .text == @ ""
? Maybe .length == 0
or something else?
"Clear" button probably sets text
property to zero
.
Whenever you want to see that the text is free to use:
if there is no text (some text is zero in someText.length == 0) {// soneText }
This works for empty code as zero
values.
Comments
Post a Comment