I have an app with a login view. In appDelegate I check if the user locks the app with a password. If he does he goes to the login view. (Code called in didFinishLaunchingWithOptions)
let storyboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let nav = storyboard.instantiateViewControllerWithIdentifier(Views.LoginVC.rawValue)
self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
self.window?.rootViewController = nav
let vc = self.storyboard?.instantiateViewControllerWithIdentifier(Views.MainVC.rawValue)
let rootVC = UINavigationController(rootViewController: vc!)
self.presentViewController(rootVC, animated: false, completion: nil)
2016-04-25 20:50:52.714 Point[7222:123809] Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has been rendered at least once before snapshotting or snapshot after screen updates.
No, I think you have an error. You should put your code in
applicationWillEnterForeground(), because you want your code to be called once every time the user runs the app.
The app is "inactive" while it's still on the screen, but not active. For example if you double-tap the home button, or if you receive an alert. The method
applicationDidBecomeActive() gets called every time the app transitions from inactive state to active.