0
我有這個應用程序,當應用程序從背景回來或第二次啓動和所有其他的後續應用程序將呈現密碼屏幕。如何在Swift中的某個時間在後臺展示UIViewController?
但我只需要呈現,如果應用程序在背景上至少30秒,並且不低於此。
我該怎麼做?
的代碼,我要加載當前密碼的屏幕是AppDelegate.swift:
func applicationDidBecomeActive(application: UIApplication) {
//Load lock screen
let topController = self.topViewControllerWithRootViewController(UIApplication.sharedApplication().delegate?.window??.rootViewController)
let userDefaults = NSUserDefaults.standardUserDefaults()
let displayedWalkthrough = userDefaults.boolForKey("Walk")
if displayedWalkthrough {
let main : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let lockVC = main.instantiateViewControllerWithIdentifier("LockVC") as! LockVC
topController.presentViewController(lockVC, animated: true, completion: nil)
} else {
}
}