Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Autofilling new password with confirmation in iOS 12

Tags:

uikit

ios12

I've added 3 UITextFields to create a new account by entering a username in email address format, a new password and a password confirmation. As suggested in Enabling Password AutoFill on a Text Input View. I have configured the username field like this

userTextField.textContentType = .username  
userTextField.keyboardType = .emailAddress

and the new password fields like this

newPasswordTextField.textContentType = .newPassword  
confirmPasswordTextField.textContentType = .newPassword

Now, when the users enters an email address as username the newPasswordTextField is pre-filled with a suggestion for a strong password (as expected), but the confirmPasswordTextField isn't filled with the same suggested password. When the user directly taps into the newPasswordTextField without entering a username before both newPasswordTextField and confirmPasswordTextField are pre-filled with the same suggested password (also as suggested).

How can i combine this both situations that after the user enters a username both password fields will be pre-filled with the same password?

like image 415
Tobe Avatar asked Aug 21 '18 09:08

Tobe


People also ask

How do you get iOS 12 to remember Passwords?

Note: In order for iPhone to create and store passwords, iCloud Keychain must be turned on. Go to Settings > [your name] > iCloud > Passwords and Keychain.

Why are my Passwords not Autofilling on my iPhone?

iOS 14 or later: Go to Settings > Passwords > AutoFill Passwords. Check that AutoFill Passwords is turned on. iOS 12 or 13: Go to Settings > Passwords & Accounts > Website & App Passwords. Check that AutoFill Passwords is turned on.

How do I create a new AutoFill password?

Setting up autofill on Android 8.0 and later versions On your Android device tap Settings — General Management — Language and input. Note: The location of this setting may differ from one Android device to another. Select Sticky Password as your Autofill service. Tap OK to indicate you trust Sticky Password.


1 Answers

I was able to do autocomplete for 2 password fields by declaring the contentType of the first field as: .password

  1. .username
  2. .password
  3. .newPassword
like image 69
cornr Avatar answered Oct 22 '22 05:10

cornr