Biometrics start and end notifications added

This commit is contained in:
Alexey Gerasimov 2018-04-05 13:22:57 +03:00
parent 03123ae15b
commit 5494db6ae9
1 changed files with 8 additions and 0 deletions

View File

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