iCloud钥匙串建议使用密码自定义UITextField

问题描述

有没有一种方法可以让钥匙串建议的密码在自定义UITextField上起作用?

我的注册场景:

enter image description here

解决方法

是的,有。您需要将UITextField的textContentType设置为UITextContentType.UITextContentTypeNewPassword(如果您希望Apple建议密码)或UITextContentType.UITextContentTypePassword(如果希望显示建议密码的QuickBar)。您可以在Apple's documentation上找到所有不同的类型。

还有来自WWDC 2017的WWDC资源Introducing Password AutoFill for Apps和来自WWDC 2018的Automatic Strong Passwords and Security Code AutoFill