IOS 8 - UITextField username provides record when becomes first responder AFTER password text field

I had a problem with the classic configuration: username / password text fields. Nothing special, only 2 UITextFields, one with "Safe Text Input" verified that it is.

When I click on the username text box, this is normal. Then I click on the password text field, the text is pinned (large dots). And when I click on the username text box again, the text of both text boxes will be protected!

If I touch the password input field before clicking on the username again, the text will be saved. However, if after that I touch the external username field and then in the username text box again, the text will not be protected. In addition, if I change the text of the text box of the username during its protection, it becomes normal again.

Error on iOS8 (not iOS7).

Any idea? Thanks!

+5
source share
3 answers

My colleague added that he worked

-(void)textFieldDidBeginEditing:(UITextField *)textField { if (textField == self.usernameText) { self.usernameText.secureTextEntry = YES; self.usernameText.secureTextEntry = NO; } } 
+4
source

This only happens when you have TEXT text in the username and password text box. This is iOS8-Bug, but as it is very likely to never happen in "real world" scenarios, it is not so bad (it’s still pretty buggy). As soon as the username no longer matches the password, it works the same as in iOS7.

Hope this helps you a little

+1
source

usernameTextField.tag = 0; passwordTextField.tag = 1;

 -(void)textFieldDidBeginEditing:(UITextField *)textField { switch(textField.tag) { case 0: textField.secureTextEntry = NO; break; case 1: textField.secureTextEntry = YES; break; default: break; } } 

It may also help.

0
source

Source: https://habr.com/ru/post/1205058/


All Articles