title: Presenting ViewController from appDelegate
body: <p>I need to show a ViewController from the appDelegate every time the app comes from the background in the applicationDidEnterBackground method.</p>
  
  <p>The *securityCheck prompts the user for a passcode very much like the normal passcode in iOS. Once the passcode is validated I call dimissViewControllerAnimated inside the securityCheck and I am left with my blank UINavigationController, since the view was presented from the appDelegate I have no record of who presented the view, so I can't popToRootViewController.</p>
  
  <p>My question is how can I properly dismiss the SecurityCheckViewController so that it shows the ViewController which the user was on before the app entered the background.</p>
  
  <p>Here's my code:</p>
  
  <p>This method is called inside AppDelegate.m</p>
  
  <pre><code>- (void)securityCheck {
  
     SecurityCheckViewController *securityCheck = [[SecurityCheckViewController alloc] init];
     UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:securityCheck];
  
     [securityCheck presentedByAppDelegate:YES];
  
     self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
     [self.window setRootViewController:navigationController];
     [self.window makeKeyAndVisible];
  }
  </code></pre>
  
  <p>Then inside the SecurityCheckViewController.m I have</p>
  
  <pre><code>- (void)unlockWasSuccessfulForPadLockScreenViewController:(ABPadLockScreenViewController *)padLockScreenViewController {
  
      [self.appDelegate securityCheckDone];
      [padLockScreenViewController dismissViewControllerAnimated:YES completion:nil];
  
       NSLog(@"Sucsessfull Unlock");I'm 
  }
  </code></pre>