Swift 3:AppDelegate不符合协议GIDSignInDelegate

时间:2016-10-28 06:09:33

标签: swift swift3 google-signin

现在我正在尝试实施Google登录。 我这样跟着:     https://developers.google.com/identity/sign-in/ios/sign-in?ver=swift

但我在AppDelegate.swift中遇到错误:

class AppDelegate: UIResponder, UIApplicationDelegate, GIDSignInDelegate 
....

错误:

  

键入' AppDelegate'不符合协议' GIDSignInDelegate'

帮助我。

1 个答案:

答案 0 :(得分:30)

您需要在GIDSignInDelegate中实现AppDelegate这两种方法。

func sign(_ signIn: GIDSignIn!, didDisconnectWith user: GIDGoogleUser!, withError error: Error!) {

}

func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error!) {

}