首页 > 解决方案 > 在范围内找不到 SignInWithAppleButton (SwiftUI 2)

问题描述

我正在 SwiftUI 应用程序(iOS 14、SwiftUI 2)中实现 Sign In With Apple。我正在导入 AuthenticationServices 框架。应用构建成功,可以在 iOS 设备或模拟器上运行。但我无法在 Preview / Canvas 中预览视图(设计视图会更容易)。

Cannot find 'SignInWithAppleButton' in scope

知道为什么吗?谢谢阿克塞尔

PS:Xcode 12 beta 6,macOS Big Sur beta 5

标签: xcodeswiftuisign-in-with-apple

解决方案


自 beta 6 以来,命名空间SignInWithAppleButton已从 移动SwiftUIAuthenticationServices。只是import AuthenticationServices.


推荐阅读