Swift 3 : AppDelegate does not conform to protocol

2019-04-29 01:41发布

Now I'm trying to implement Google Login. I followed like this : https://developers.google.com/identity/sign-in/ios/sign-in?ver=swift

But I got a error in AppDelegate.swift :

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

error :

Type 'AppDelegate' does not conform to protocol 'GIDSignInDelegate'

Help me.

1条回答
放荡不羁爱自由
2楼-- · 2019-04-29 02:37

You need to implement these two methods of GIDSignInDelegate in your AppDelegate.

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

}

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

}
查看更多
登录 后发表回答