From 5494db6ae94d7731463396581ff4bd71307a522a Mon Sep 17 00:00:00 2001 From: Alexey Gerasimov Date: Thu, 5 Apr 2018 13:22:57 +0300 Subject: [PATCH] Biometrics start and end notifications added --- .../PassCode/ViewModel/BasePassCodeViewModel.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Sources/Controllers/PassCode/ViewModel/BasePassCodeViewModel.swift b/Sources/Controllers/PassCode/ViewModel/BasePassCodeViewModel.swift index a41fc6b..d0a1d29 100644 --- a/Sources/Controllers/PassCode/ViewModel/BasePassCodeViewModel.swift +++ b/Sources/Controllers/PassCode/ViewModel/BasePassCodeViewModel.swift @@ -101,9 +101,11 @@ open class BasePassCodeViewModel: BaseViewModel { } public func authenticateUsingBiometrics(with description: String, fallback: String?, cancel: String?) { + biometricsAuthBegins() biometricsService.authenticateWithBiometrics(with: description, fallback: fallback, cancel: cancel) { [weak self] success, error in + self?.biometricsAuthEnds() if success { self?.authSucceed(.touchId) } else { @@ -142,6 +144,12 @@ open class BasePassCodeViewModel: BaseViewModel { assertionFailure("You should override this method: activateBiometricsForUser()") } + /// Notify before system alert with biometrics + open func biometricsAuthBegins() {} + + /// Notify after system alert with biometrics + open func biometricsAuthEnds() {} + } private extension BasePassCodeViewModel {