Hi Im using Sinch sms verification to sign up users in my app but after updating my code to swift 3 (and sinch sdk currently 2.0.3), Im getting the following error
Cannot convert value of type '(Bool, NSError?) -> Void' to expected argument type '(Bool, Error?) -> Void'
I know that if I change NSError to Error , this error disappear
but I need to get the error code from the NSError to alert my user on what happened depend on this error
if (result.success){
//login user
} else {
if error!.code == 6 {
let msg = NSLocalizedString("This Phone Number is invalid",
comment: "This Phone Number is invalid pop up alert")
print(msg)
}
}
From Sinch Docs , Im suppose to use this NSError:
https://www.sinch.com/docs/verification/ios/#swiftsdk
let verification = SMSVerification(applicationKey:"<APP KEY>", phoneNumber: phoneNumberInE164)
verification.initiate { (result: InitiationResult, error: NSError?) -> Void in
// handle outcome
}
Is there a way to get the error.code from error:Error? Thanks for your help