As of now I would like to opt out of the new option iOS 11 gives, that is to suggest passwords in the app. When I run the app on iOS 11 I get the autofill option on top of the keyboard and my username and password textfield don't even show up.
So, my question is, how can I disable the new password autofill feature all together so the key on the keyboard is not shown at all and the overall behavior is the same as pre iOS 11?
Prevent iPhone from automatically filling in passwordsGo to Settings > Passwords > AutoFill Passwords, then turn off AutoFill Passwords.
Safari. Click the Safari menu and choose Preferences. Click the AutoFill icon. Turn off all the AutoFill settings: “Using info from my contacts,” “User names and passwords,” “Credit cards,” and “Other forms.”
iOS 11 & 12 & 13 - Swift 4.2 & 5 (Updated):
if #available(iOS 12, *) { // iOS 12 & 13: Not the best solution, but it works. passwordTextField.textContentType = .oneTimeCode } else { // iOS 11: Disables the autofill accessory view. // For more information see the explanation below. emailTextField.textContentType = .init(rawValue: "") passwordTextField.textContentType = .init(rawValue: "") }
iOS 11 explanation:
Make sure you setup all of your UITextField
objects like this.
If you have for example an UITextField
object where the user must enter his email address and another one where the user must enter his password assign UITextContentType("")
to both of their textContentType
property. Otherwise it will not work and the autoFill accessory view will still be shown.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With