improve passcode
This commit is contained in:
parent
97056ab91c
commit
9816e7677d
3 changed files with 10 additions and 10 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -56,11 +56,6 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV
|
|||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
if PasscodeLockRepository().hasPasscode {
|
||||
let passcodeEnterViewController = PasscodeLockViewController(state: .enter, configuration: Globals.passcodeConfiguration)
|
||||
UIApplication.shared.keyWindow?.rootViewController?.present(passcodeEnterViewController, animated: true, completion: nil)
|
||||
}
|
||||
passwordEntities = PasswordStore.shared.fetchPasswordEntityCoreData()
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(PasswordsViewController.actOnPasswordUpdatedNotification), name: NSNotification.Name(rawValue: "passwordUpdated"), object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(PasswordsViewController.actOnPasswordStoreErasedNotification), name: NSNotification.Name(rawValue: "passwordStoreErased"), object: nil)
|
||||
|
|
|
|||
|
|
@ -155,6 +155,8 @@ class SettingsTableViewController: UITableViewController {
|
|||
Defaults[.isTouchIDOn] = false
|
||||
Globals.passcodeConfiguration.isTouchIDAllowed = false
|
||||
}
|
||||
let appDelegate = UIApplication.shared.delegate as! AppDelegate
|
||||
appDelegate.passcodeLockPresenter = PasscodeLockPresenter(mainWindow: appDelegate.window, configuration: Globals.passcodeConfiguration)
|
||||
}
|
||||
|
||||
func showPasscodeActionSheet() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue