小编Fra*_*ank的帖子

如何在 SwiftUi 中将 rootViewController 传递给 Google 登录?

这是我多年来找到我需要的每个答案后的第一个问题。

\n

我在 IOS 中为 iPhone 编写了一些应用程序,我并不总是确定我在做什么,但它们可以工作!

\n

他们使用 Google 登录,并且工作正常。\n现在我想为 Mac OS 编写一个应用程序,但我无法解决的问题是这一行:

\n
GIDSignIn.sharedInstance.signIn(withPresenting: rootViewController) \n
Run Code Online (Sandbox Code Playgroud)\n

在这个函数中:

\n
func handleSignInButton() {\n\xc2\xa0 GIDSignIn.sharedInstance.signIn(\n\xc2\xa0 \xc2\xa0 withPresenting: rootViewController) { signInResult, error in\n\xc2\xa0 \xc2\xa0 \xc2\xa0 guard let result = signInResult else {\n\xc2\xa0 \xc2\xa0 \xc2\xa0 \xc2\xa0 // Inspect error\n\xc2\xa0 \xc2\xa0 \xc2\xa0 \xc2\xa0 return\n\xc2\xa0 \xc2\xa0 \xc2\xa0 }\n\xc2\xa0 \xc2\xa0 \xc2\xa0 // If sign in succeeded, display the app\'s main content View.\n\xc2\xa0 \xc2\xa0 }\n\xc2\xa0 )\n}\n
Run Code Online (Sandbox Code Playgroud)\n

在 Google 登录教程中:\n https://developers.google.com/identity/sign-in/ios/sign-in

\n

我可以用什么来替换 Mac OS 应用程序中的 …

google-signin rootviewcontroller swiftui

6
推荐指数
1
解决办法
1539
查看次数