I am using the Google Calendar API for IOS. I've bridged it so that I can use it in swift. Authorisation works great up until the point that the callback is called (i.e I can see in my Google account the authorisation took place).
In their example they have a selector to handle successful authentication as follows.
// Handle completion of the authorization process, and update the Google Calendar API
// with the new credentials.
- (void)viewController:(GTMOAuth2ViewControllerTouch *)viewController
finishedWithAuth:(GTMOAuth2Authentication *)authResult
error:(NSError *)error {
//...
}
I have translated this selector as follows...
func finishedAuthorisation(viewController:GTMOAuth2ViewControllerTouch?, authResult:GTMOAuth2Authentication?, error:NSError?){
//...
}
... and use it like this ...
GTMOAuth2ViewControllerTouch(scope: " ".join(scopes), clientID: kClientID, clientSecret: kClientSecret, keychainItemName: kKeychainItemName, delegate: self, finishedSelector: "finishedAuthorisation:")
... which results in this error
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSInvocation _invocationWithMethodSignature:frame:]: method signature argument cannot be nil'
What am I doing wrong here?