Merge pull request #52 from TouchInstinct/add_touch_id_recognition

Add isTouchId to BiometricsService
This commit is contained in:
Aliona 2018-07-25 16:18:54 +03:00 committed by GitHub
commit 9399fcb511
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions

View File

@ -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`

View File

@ -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"

View File

@ -29,6 +29,15 @@ 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 canAuthenticateWithBiometrics && 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