ios - Is an event triggered when a UITextField with secureTextEntry = YES is cleared? -
i have uitextfield instance securetextentry = yes
. when field first gains focus keypress clear field, appears standard behavior on ios.
as far can tell, uicontroleventeditingchanged
not triggered. have tried subscribing uicontroleventalleditingevents
appears not triggered. causing issue me since i'm relying on knowing when field edited set enabled
attribute of uibutton.
is there event fired when field cleared in way?
they context around issue can seen in github issue.
you can use uitextfield's delegate:
- (bool) textfield:(uitextfield *)textfield shouldchangecharactersinrange:(nsrange)range replacementstring:(nsstring *)string { nsstring *newtext = [textfield.text stringbyreplacingcharactersinrange:range withstring:text]; [self performselector:@selector(updatebutton) withobject:nil afterdelay:0.1]; return yes; } - (bool)textfieldshouldclear:(uitextfield *)textfield { [self performselector:@selector(updatebutton) withobject:nil afterdelay:0.1]; return yes; } - (void) updatebutton { somebutton.enabled = no; }
Comments
Post a Comment