Raluca Sanda Raluca Sanda - 27 days ago 11
Swift Question

it appears an extra argument 'reply' in call at : reply: { ( success, error) in - what cand i do because i can not build the app in the simulator

enter image description here

it appears an extra argument 'reply' in call at : reply: { ( success, error) in - what cand i do because i can not build the app in the simulator
let authenticationContext = LAContext()
var error: NSError?

if authenticationContext.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error) {
authenticationContext.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, localizedReason:"Not let somebody else", reply: { (success, error) in

if success {
self.navigateToAuthenticatiedVC()
} else{
if let error = error as? NSError {
let message = self.errorMessageForErrorCode(errorCode: error.code)
self.showAlertViewAfterEvaluatingPolicyWithMessage(message: message)
}
}

})

Answer

You should call evaluatePolicy(..., reply: ...) on that line, not canEvaluatePolicy.

Comments