0

When using the SwiftUI TextField, I use SecureField to have the password treatment. However it is only giving the option to access previously established passwords.

enter image description here

How can I make it suggest a new password, as this is a signup form that I am working on.

This is what I want:

enter image description here

ScottyBlades
  • 12,189
  • 5
  • 77
  • 85

1 Answers1

3

It should be as simple as yourTextField.contentType = .newPassword.

Unfortunately, that doesn't work. You must:

  1. Also have a text field set to .username

Username text field above NewPassword text field

  1. Enable iCloud Keychain, otherwise you get this error:

[AutoFill] Cannot show Automatic Strong Passwords for app bundleID: com.aheze.YOURAPP due to error: iCloud Keychain is disabled

  1. And even after that, you get this error (which seems to be an iOS 14 problem):

[KBDAnalyticsLog] -[TIAnalyticsService _registerEventSpec:withCompletionHandler:]_block_invoke TIAnalyticsEventSpec with name 'thirdPartyKeyboards' is already registered.

All in all, it's very broken. I couldn't get it to work.

Similar issues

aheze
  • 24,434
  • 8
  • 68
  • 125