Closed d0hnj0e closed 6 years ago
fixed by:
public func faceIDAvailable() -> Bool { if #available(iOS 11.0, *) { let context = LAContext() return (context.canEvaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, error: nil) && context.biometryType == .faceID) // changed } return false }
It's working on Xcode 9.1, iOS 11, Swift 3.2 and Swift 4.0. Could you please mention Xcode, iOS and Swift version that you're using.
He was using Xcode 9.2, looks like some keywords changed. Fixed this issue through(.typeFaceID -> .faceID, .typeTouchID -> .touchID)
public func faceIDAvailable() -> Bool { if #available(iOS 11.0, *) { let context = LAContext() return (context.canEvaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, error: nil) && context.biometryType == .typeFaceID) } return false }
returns an error