improve passcode

This commit is contained in:
Bob Sun 2017-02-08 14:53:07 +08:00
parent 97056ab91c
commit 9816e7677d
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4
3 changed files with 10 additions and 10 deletions

View file

@ -15,9 +15,15 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
lazy var passcodeLockPresenter: PasscodeLockPresenter = {
let presenter = PasscodeLockPresenter(mainWindow: self.window, configuration: Globals.passcodeConfiguration)
return presenter
}()
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
passcodeLockPresenter.present()
print("Present")
if let shortcutItem = launchOptions?[UIApplicationLaunchOptionsKey.shortcutItem] as? UIApplicationShortcutItem {
print(shortcutItem.type)
if shortcutItem.type == "me.mssun.pass.search" {
@ -49,10 +55,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
if PasscodeLockRepository().hasPasscode {
let passcodeEnterViewController = PasscodeLockViewController(state: .enter, configuration: Globals.passcodeConfiguration)
UIApplication.shared.keyWindow?.rootViewController?.present(passcodeEnterViewController, animated: true, completion: nil)
}
passcodeLockPresenter.present()
}
func applicationWillEnterForeground(_ application: UIApplication) {