objective c - Show/Hide Password Toggle. Bug or Feature? -
i'm developing ipad application using xcode , objective-c. have ui includes password entry field , show/hide button (code shown below). tester has pointed out following inconsistent behaviour.
if password hidden , half typed in (e.g. "abc") , user hits toggle button show password , continues typing new characters (e.g. "def") added end of initial entry (making "abcdef"). , good.
however, if password shown , half typed in (e.g. "abc") , user hits toggle button hide password , continues typing new characters (e.g. "def") replace initial entry (making "def"). show/hide toggle not shows or hides text changes behaviour of uitextfield (append / clear , start over) when next character entered.
i can think of (not good) reasons why behaviour design, no 1 i've shown thinks good. can suggest quick fix (that prevents toggle hide text action clearing part entered password)?
- (ibaction)togglepasswordreveal:(id)sender { if ([self.revealbutton.titlelabel.text isequaltostring:@"show"]) { self.password.securetextentry = no; [self.revealbutton settitle:@"hide" forstate:uicontrolstatenormal]; } else { self.password.securetextentry = yes; [self.revealbutton settitle:@"show" forstate:uicontrolstatenormal]; } }
i can't find documentation it, recall changing secure entry setting changes clearsoninsertion
.
look @ setting clearsoninsertion
, / or using delegate methods textfieldshouldclear:
, textfield:shouldchangecharactersinrange:replacementstring:
modify behaviour.
i guess logic user not sure typed can't see characters sage option force user start over.
Comments
Post a Comment