Swift 3:Appdelegate Does Not Conform to Protocol Gidsignindelegate

Swift 3 : AppDelegate does not conform to protocol GIDSignInDelegate

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!) {

}

AppDelegate' does not conform to protocol 'GIDSignInDelegate'

I just spent 3 hours on this. The correct signature you need to implement is :

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

But - check whether you are not overriding the definition of Error in your app (or the other classes GIDSignIn, GIDGoogleUser). I had a custom Error class in my app which has overridden the default Error class. After I renamed my Error class, the problem went away.

Swift compiler was not very helpful here, because it displayed the type as Error for both cases in the error message, while not indicating they both mean different Error types.

The lesson is to not use names already used in Foundation for my classes.

AppDelegate does not conform to protocol 'GIDSignInDelegate' in Swift 3

It looks like you defined the methods of that protocol outside of the AppDelegate class, so they are just global functions, not methods.

You need to move them inside the } that closes AppDelegate (just above the first protocol method).

Tip: if you select all of the code in that file and press Ctrl+I Xcode will reindent your code which may make it easier to see what's going wrong.

appdelegate does not conform to protocol GPPSignInDelegate

From what i read on the documentation you have two methods to implement if you want to conform to the delegate :

  • finishedWithAuth:error:
  • didDisconnectWithError:

so in code that should look like :

extension AppDelegate : GPPSignInDelegate {

func finishedWithAuth(auth: GTMOAuth2Authentication!, error: NSError!) {
}

func didDisconnectWithError(error: NSError!) {
}

}

Type 'AppDelegate' does not conform to protocol 'CLLocationManagerDelegate' - Swift in Xcode 6

The error says:

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

So:

You are getting it because your class with the name AppDelegate does not conform to the protocol CLLocationManagerDelegate.

You can fix this by making that class conform to that protocol. So implement the methods that are required by the protocol, then declare that your class conforms to it.



Related Topics



Leave a reply



Submit