title: Display Passcode / Pincode upon launching the app - Storyboard
body: <p>I am trying to display a passcode/pincode (modal view controller) upon launching the app. You may see the code in AppDelegate.h :</p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  {
  
      if (![[NSUserDefaults standardUserDefaults] boolForKey:@"passcode_in"]) {
          //display passcode screen
          UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
          UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"PasscodeViewController"];
          [vc setModalPresentationStyle:UIModalPresentationFullScreen];
  
          [self presentModalViewController:vc animated:NO]; 
  
  
       } else {
          NSLog(@"No Passcode Screen");
  }
  
     return YES;
  }
  </code></pre>
  
  <p>The problem is that AppDelegate doesn't support to display a modal view controller (presentModalViewController). I am not going to use .xib files, only Storyboard for my app. Does anybody know what is wrong with it? Any suggestion appreciated.</p>
  
  <p><strong>RESOLVED</strong></p>
  
  <p>I followed the instruction given to one of my previous posted questions <a href="https://stackoverflow.com/a/10303870/1344459">https://stackoverflow.com/a/10303870/1344459</a> I resolved the issue by only adding some code into two methods <strong>applicationDidEnterBackground</strong> and <strong>applicationWillTerminate</strong> in AppDelegate.m for PinCodeViewController(modal) upon launching app. Now it is working so smooth. </p>