首页 > 解决方案 > 获取 iOS 密码自动填充以使用“更改密码”页面

问题描述

我已经让 iOS 密码自动填充功能与“登录”和“新帐户”页面一起使用,但不是“更改密码”页面。我在那个页面上有 4 个 UITextFields。1 使用 .email 作为内容类型,1 使用 .password 作为原始密码的内容类型,2 使用 .newPassword 作为新密码的内容类型。

自动填充尝试使用新生成的密码填充 .password 和第一个 .newPassword 字段,最后一个字段为空白。我试过切换顺序,但密码没有在钥匙串中更新。

我尝试只使用 2 个 .newPassword 字段,但它仍然没有更新它们的钥匙串。

有谁知道如何让它工作,或者是否有关于“更改密码”屏幕最佳实践的教程?Apple 的文档仅涵盖登录和新帐户。

谢谢。

标签: iosxcodeios11keychainios12

解决方案


I experience the same problem: AutoFill fills old password and new password field with the same generated password.

I solved this by moving the old password field up above the username.

  • Current password (content type: password)
  • Username (content type: username) (in my case this is a non editable pre-filled text field)
  • New password (content type: newPassword)

It's a bit strange but after the view controller dismisses the keychain password is updated immediately without confirmation.


推荐阅读