WWDC18 - Session 204 Automatic Strong Passwords and Security Code AutoFill 笔记
作者:我是 RocZhang,大四在读,目前在流利说做 iOS 开发
个人作品:Adonis / Mr.Weather / YearTimer
关于我: 关于我 | Roc Zhang's Blog
在 iOS 12 中,Apple 将自动建议与使用强唯一密码的功能带入了 App 内,通过 QuickType bar 大幅简化了用户设置账户与登陆的繁琐操作。本 session 介绍了如何优化应用如何适配密码、安全码和其他自动填充功能,带给用户更安全与无缝的体验。
Password AutoFill 自动密码填充
在 iOS 11 中,Apple 引入了自动填充密码。此功能可以让用户通过点击键盘上方的 QuickType bar 快速完成用户名与密码输入过程。首先是对此功能的概要重述,重点包括:
1.设置 Associated domains 关联域。iCloud Keychain Password Manager 中的密码是基于 Web 上的 domain 域(如 apple.com)来存储的。因此,就需要将 App 与 Web 上的域关联起来。关于 Password AutoFill 的详细功能,可见 WWDC 17 - Session 206 - Introducing Password AutoFill for Apps。
2.标记好 Content types。在 iOS 11 中,UITextContentType 中添加了新类型:username 及 password。只要给输入框设定好正确的 textContentType 即可。如: