Skip to content

Commit 70d1532

Browse files
committed
Merge pull request velikanov#15 from ziogaschr/public-evaluate-biometrics
Make `authenticateWithBiometrics` public so as App can present it if needed
2 parents 68bbdb9 + 63080ee commit 70d1532

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

PasscodeLock/PasscodeLockViewController.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public class PasscodeLockViewController: UIViewController, PasscodeLockTypeDeleg
9191
public override func viewDidAppear(animated: Bool) {
9292
super.viewDidAppear(animated)
9393

94-
if shouldTryToAuthenticateWithBiometrics {
94+
if shouldTryToAuthenticateWithBiometrics && passcodeConfiguration.shouldRequestTouchIDImmediately {
9595

9696
authenticateWithBiometrics()
9797
}
@@ -121,7 +121,9 @@ public class PasscodeLockViewController: UIViewController, PasscodeLockTypeDeleg
121121

122122
public func appWillEnterForegroundHandler(notification: NSNotification) {
123123

124-
authenticateWithBiometrics()
124+
if passcodeConfiguration.shouldRequestTouchIDImmediately {
125+
authenticateWithBiometrics()
126+
}
125127
}
126128

127129
public func appDidEnterBackgroundHandler(notification: NSNotification) {
@@ -153,9 +155,9 @@ public class PasscodeLockViewController: UIViewController, PasscodeLockTypeDeleg
153155
passcodeLock.authenticateWithBiometrics()
154156
}
155157

156-
private func authenticateWithBiometrics() {
158+
public func authenticateWithBiometrics() {
157159

158-
if passcodeConfiguration.shouldRequestTouchIDImmediately && passcodeLock.isTouchIDAllowed {
160+
if passcodeLock.isTouchIDAllowed {
159161

160162
passcodeLock.authenticateWithBiometrics()
161163
}

0 commit comments

Comments
 (0)