Move isFaceIdSupported to Leadkit
This commit is contained in:
parent
b6c8200015
commit
c27a031dcc
|
|
@ -1,6 +1,10 @@
|
|||
# Changelog
|
||||
|
||||
|
||||
### 0.3.4
|
||||
|
||||
- **Add**: `isFaceIdSupported` variable to `BiometricsService` to distinguish FaceID from TouchID.
|
||||
|
||||
### 0.3.3
|
||||
|
||||
- **Add**: Public `init` to `BiometricsService`
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
Pod::Spec.new do |s|
|
||||
s.name = "LeadKitAdditions"
|
||||
s.version = "0.3.3"
|
||||
s.version = "0.3.4"
|
||||
s.summary = "iOS framework with a bunch of tools for rapid development"
|
||||
s.homepage = "https://github.com/TouchInstinct/LeadKitAdditions"
|
||||
s.license = "Apache License, Version 2.0"
|
||||
|
|
|
|||
|
|
@ -29,6 +29,16 @@ public final class BiometricsService {
|
|||
|
||||
private lazy var laContext = LAContext()
|
||||
|
||||
/// Returns true if user can authenticate via faceID
|
||||
public var isFaceIdSupported: Bool {
|
||||
if #available(iOS 11.0, *) {
|
||||
return laContext.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: nil)
|
||||
&& laContext.biometryType == .faceID
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns current domain state
|
||||
public var evaluatedPolicyDomainState: Data? {
|
||||
// We need to call canEvaluatePolicy function for evaluatedPolicyDomainState to be updated
|
||||
|
|
|
|||
Loading…
Reference in New Issue