diff --git a/CHANGELOG.md b/CHANGELOG.md index d1c7870..a207bfe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog + +### 0.3.4 + +- **Add**: `isFaceIdSupported` variable to `BiometricsService` to distinguish FaceID from TouchID. + +### 0.3.3 + +- **Add**: Public `init` to `BiometricsService` + +### 0.3.2 + +- **Add**: functions to `BasePassCodeViewController` to make `fakeTextField` become and resign first responder + ### 0.3.1 - **Add**: `PinLayoutTableViewCell` and `SeparatorTableViewCell` to `Core-iOS-Extension`. diff --git a/Sources/Controllers/PassCode/View/BasePassCodeViewController.swift b/Sources/Controllers/PassCode/View/BasePassCodeViewController.swift index 2c12fc3..87958df 100644 --- a/Sources/Controllers/PassCode/View/BasePassCodeViewController.swift +++ b/Sources/Controllers/PassCode/View/BasePassCodeViewController.swift @@ -248,6 +248,18 @@ open class BasePassCodeViewController: UIViewController, ConfigurableController titleLabel?.attributedText = actionTitle(for: passCodeControllerState) } + // MARK: - Public functions + + /// Make fakeTextField become first responder + public func enableInput() { + fakeTextField.becomeFirstResponder() + } + + /// Make fakeTextField resign first responder + public func disableInput() { + fakeTextField.resignFirstResponder() + } + // MARK: - ConfigurableController open func bindViews() { diff --git a/Sources/Services/BiometricsService.swift b/Sources/Services/BiometricsService.swift index 504045f..37ee7f0 100644 --- a/Sources/Services/BiometricsService.swift +++ b/Sources/Services/BiometricsService.swift @@ -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 @@ -64,4 +73,6 @@ public final class BiometricsService { } } + public init() {} + }