we have the following code to perform biometric authentication
class func canEvaluateDeviceOwnerAuthenticationWithBiometrics() -> (result: Bool, error: Error?) {
var error: NSError?
let result = LAContext().canEvaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, error: &error)
return (result, error)
}
after calling this method we translate it into an LAError and do a switch on the LAError.Code
let laError = LAError(_nsError: error as NSError)
sadly we had a crash on iphone 6, ios 12
apparently the code was -1000, which is not one of the enum options
Crashed: com.apple.main-thread
0 libswiftCore.dylib 0x102aefbbc specialized _assertionFailure(_:_:flags:) + 81808
1 libswiftCore.dylib 0x10294f1bc _diagnoseUnexpectedEnumCaseValue<A, B>(type:rawValue:) + 140412
how is this possible?