Set a PasswordField to secureTextEntry give me a strange behaviour

后端 未结 7 1958
感动是毒
感动是毒 2021-01-07 18:01

I have a passwordField who i set the isSecureTextEntry to true, for hidden the characters. But when I click to this passwordField this show me this

相关标签:
7条回答
  • 2021-01-07 18:19

    I borrowed @Hamid Reza Ansari's answer above, but also had to support older iOS versions, so wrapped it in a condition:

    if #available(iOS 12.0, *) {
        self.textContentType = .oneTimeCode
    }
    
    0 讨论(0)
  • 2021-01-07 18:24

    in my case: I have 4 fields (username-email-pass-confirm pass) and when the user tap on password or confirm password fields the keyboard return that error and show a strong password suggestion and don't let to change the password field text.

    solution: I changed all fields Content type to (One Time Code) and just set (Secure Text Entry = true) in the password and confirm password fields.

    0 讨论(0)
  • 2021-01-07 18:28

    Automatic Strong Passwords :- Enable iCloud Keychain

    Automatic Strong Passwords suggestion works if user has enabled the iCloud keychain in its iPhone.

    I was able to solved by these following steps:-

    • Go to the Setting
    • Tap on UserName (Apple Id)
    • Tap on iCloud
    • Tap on keychain
    • Enable iCloud Keychain
    0 讨论(0)
  • 2021-01-07 18:32

    In our case we had another text field on same screen with content type Email Address, changing that to Username magically solved the problem.

    0 讨论(0)
  • 2021-01-07 18:33

    This happens when the system's user doesn't have iCloud Keychain enabled. As will often be the case on the Simulator :)

    I ran into this on the simulator and came here. Tried it on my phone (where iCloud Keychain is enabled), and got this instead:

    [AutoFill] Cannot show Automatic Strong Passwords for app bundleID: your.bundle.id due to error: Cannot save passwords for this app. Make sure you have set up Associated Domains for your app and AutoFill Passwords is enabled in Settings

    So this is Apple's cool AutoFill feature. There are some steps described here that should enable that.

    0 讨论(0)
  • 2021-01-07 18:33

    I was having same issue while i was running my application on the simulator. Setting autocorrection to no solved my issue. I hope it helps you.

    textFieldPassword.autocorrectionType = .no
    
    0 讨论(0)
提交回复
热议问题