From fa73ffa828017af015032d7b3f123cdbbcd55070 Mon Sep 17 00:00:00 2001 From: Mauro Torres Mejia Date: Fri, 16 Jun 2017 12:31:10 +0200 Subject: [PATCH] Send notification when maximum failed attempt reached --- PasscodeLock/PasscodeLock/EnterPasscodeState.swift | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/PasscodeLock/PasscodeLock/EnterPasscodeState.swift b/PasscodeLock/PasscodeLock/EnterPasscodeState.swift index 86a75a87..89b611db 100644 --- a/PasscodeLock/PasscodeLock/EnterPasscodeState.swift +++ b/PasscodeLock/PasscodeLock/EnterPasscodeState.swift @@ -20,7 +20,6 @@ struct EnterPasscodeState: PasscodeLockStateType { var font : UIFont? private var inccorectPasscodeAttempts = 0 - private var isNotificationSent = false init(allowCancellation: Bool = false, stringsToShow: StringsToBeDisplayed?, tintColor: UIColor?, font: UIFont?) { @@ -53,11 +52,8 @@ struct EnterPasscodeState: PasscodeLockStateType { } private mutating func postNotification() { - - guard !isNotificationSent else { return } - + let center = NSNotificationCenter.defaultCenter() center.postNotificationName(PasscodeLockIncorrectPasscodeNotification, object: nil) - self.isNotificationSent = true } }