iOS 11 disable password autofill accessory view option?

后端 未结 20 2543
孤独总比滥情好
孤独总比滥情好 2020-11-28 04:20

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 t

20条回答
  •  伪装坚强ぢ
    2020-11-28 04:47

    This worked for me:

    NOTE: try putting this code on the password, password confirm (if applicable), AND email textfields. I was not putting it on the email textfield and it was still popping up for the two password fields.

    if #available(iOS 12, *) {
         // iOS 12: Not the best solution, but it works.
         cell.textField.textContentType = .oneTimeCode
    } else {
         // iOS 11: Disables the autofill accessory view.
         cell.textField.textContentType = .init(rawValue: "")
    }
    

提交回复
热议问题