i'm using Xcode8 and swift 3. So I fully converted my project to the latest syntax and now i get the error:
'Error' is ambiguous for type lookup in this context
in the function:
func loginButton(_ loginButton: FBSDKLoginButton!, didCompleteWith result: FBSDKLoginManagerLoginResult!, error: Error!) {
//do stuff
}
The function in FBSDK declared as follows:
- (void) loginButton:(FBSDKLoginButton *)loginButton
didCompleteWithResult:(FBSDKLoginManagerLoginResult *)result
error:(NSError *)error;
so I tried to change Error type to NSError but i get the other error:
'SignInViewController' does not conform to protocol 'FBSDKLoginButtonDelegate'
I don't know what to do. Any help is appreciated!
The syntax in FBSDKLoginButtonDelegate method is changed like below in Swift 3.
"didCompleteWithResult result" is changed to "didCompleteWith result".
I found that i've imported
RealmSwift
that have their ownError
struct. So the solution is to useSwift.Error
instead of justError
. Hope this helps to anybody.