iOS 11 disable password autofill accessory view option?

后端 未结 20 2476
孤独总比滥情好
孤独总比滥情好 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:37

    You can add extension for UITextContentType like this

    extension UITextContentType {
        public static let unspecified = UITextContentType("unspecified")
    }
    

    after that, you can use it

    if #available(iOS 10.0, *) {
        passwordField.textContentType = .unspecified
    }
    

提交回复
热议问题