Closed le4ker closed 8 years ago
@PanosSakkos You have to add an observer for the notification. The documentation is a little misguiding and providing wrong name.
You can put this in your first root controller's viewDidLoad.
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(logoutApp(_:)), name: "passcode.lock.incorrect.passcode.notification", object: nil)
Then you have to implement the logoutApp function. This is just an example.
func logoutApp(notification: NSNotification) {
// Destroy sensitive stuff.
let delegate = UIApplication.sharedApplication().delegate as! AppDelegate
self.presentedViewController?.dismissViewControllerAnimated(false, completion: {
delegate.passcodeLockPresenter.dismissPasscodeLock(animated: true)
})
}
@antonigiske thanks for the reply!
For some reason the dismissPasscodeLock method is private in my PasscodeLockPresenter. I checked the repo here and the source code is different, with this method offered as public.
I did a carthage update but I still don't have the latest source code
Any ideas?
Thanks! :panos
@PanosSakkos I don't know. I used CocoaPods, and its public with me.
Got it from CocoaPods and it worked, thanks! 👍
First of all, great stuff!
Second, I have the scenario where a user reaches the max number of passcode attempts. When this happens, I want to delete all the sensitive information of the app and destroy the PasscodeViewController.
How can I do the latter?
Thanks! :panos