The above says it all- I have a UITextField set to secure, but want to give users the option to make it not secure (so they can see for sure what they typed if they are in a pri
Mike R's solution is nice, but I prefer this approach:
BOOL wasFirstResponder;
if ((wasFirstResponder = [passwordField isFirstResponder])) {
[passwordField resignFirstResponder];
}
// In this example, there is a "show password" toggle
[passwordField setSecureTextEntry:![passwordField isSecureTextEntry]];
if (wasFirstResponder) {
[passwordField becomeFirstResponder];
}
That way you only becomeFirstResponder again when necessary.