I'm using a library exposing the following objective-c method:
- (void)signIn:(NSString *)username password:(NSString *)password completion:(void (^)(User *user, NSError *error))completion;
I'd like to call the method from swift 3 like this:
sign(in: "abc", password: "def") { (user: User?, error: NSError?) -> Void in
// ...
}
The compiler raises the following error:
Cannot convert value of type '(User?, NSError?) -> Void' to expected argument type '((User?, Error?) -> Void)!'
What am I missing in this example?