ios - .newPassword for SecureField 选择强密码在使用 SwiftUI 和 iOS14 时不起作用

标签 ios xcode swiftui securefield

我正在尝试使用 SwiftUI 在 SecureField 中使用强密码建议功能,但它不起作用。只是想知道我是做错了什么还是这是一个错误。

@State var password: String = ""
@State var confirmPassword: String = ""

var body: some View {
    
    VStack {
        SecureField("Password", text: $password) {
            // do something
        }
        .textContentType(.newPassword)
        SecureField("Confirm Password", text: $confirmPassword) {
            // do something
        }
        .textContentType(.newPassword)
    }
}
当我选择 secureField 时,它不建议使用强密码。
编辑:
经过进一步的测试和下面的评论后,我添加了一个关联的域并将以下 Web 凭据文件上传到我的网络服务器 example.com/.well-known/apple-app-site-association.txt:
{
        "webcredentials": {
                "apps": [ " TEAMID.com.example.AppName" ]
        }
}
我目前的功能是关联域和自动填充凭据提供程序设置为 YES。
当我尝试使用强密码时,我收到以下错误消息:

Cannot show Automatic Strong Passwords for app bundleID: com.example.AppName due to error: Cannot identify the calling app's process. Check teamID and bundleID in your app's application-identifier entitlement


不知道从这里去哪里。

最佳答案

如果您想建议新密码,则需要使用 .newPassword 文本内容类型。.password用于输入现有密码。

关于ios - .newPassword for SecureField 选择强密码在使用 SwiftUI 和 iOS14 时不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66620520/

相关文章:

ios - Xcode 6.1 dyld : Library not loaded: @rpath/XCTest. 框架/XCTest 错误

ios - 从不兼容的类型 'NSObject<PushNotificationDelegate> *' 分配给 'AppDelegate *const __strong'

objective-c - 是否可以以非编程方式查看核心数据表中的条目?

ios - 如何在 SwiftUI 中更新 TextField 的值?

swift - 在 map SwiftUI 上显示用户位置

ios - 在 UITableView 的一部分上使用 NSFetchedResultsController

iphone - 如何更改 Ray Wenderlich 的 UIScrollView 教程的当前页面?

swift - 当 AsyncImage SwiftUI 中的图像 URL 发生变化时,如何监听新阶段的成功

ios - 在自动布局 (iOS) 中将一个项目置于其他两个项目之间

ios - 如何设置NSDateFormatter解析 "..GMT+0000 (UTC)"