title: Xcode: Display Login View in applicationDidBecomeActive
body: <p>In my app I would like to show a login screen - which will be displayed when the app starts and when the app becomes active. For reference, I am using storyboards, ARC and it is a tabbed bar application.</p>
  
  <p>I therefore need to do the process in the <code>applicationDidBecomeActive</code> method:</p>
  
  <pre><code>- (void)applicationDidBecomeActive:(UIApplication *)application
  {
      if ( ... ) { // if the user needs to login
          PasswordViewController *passwordView = [[PasswordViewController alloc] init];
          UIViewController *myView = self.window.rootViewController;
          [myView presentModalViewController:passwordView animated:NO];
      }
  }
  </code></pre>
  
  <p>To an extent this does work - I can call a method in <code>viewDidAppear</code> which shows an alert view to allow the user to log in. However, this is undesirable and I would like to have a login text box and other ui elements. If I do not call my login method, nothing happens and the screen stays black, even though I have put a label and other elements on the view.</p>
  
  <p>Does anyone know a way to resolve this? My passcode view is embedded in a Navigation Controller, but is detached from the main storyboard.</p>