title: What is rootViewController & when do I use it?
body: <p>while integrating a payment gateway in my iOS app, I used <code>rootViewController</code> property as below:</p>
  
  <pre><code> UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
  
   UINavigationController *controller = [storyboard instantiateViewControllerWithIdentifier:@"navCtrlID"];
  
   [[UIApplication sharedApplication].keyWindow setRootViewController:controller];
  
   [self.navigationController presentViewController:controller animated:YES completion:nil];
  </code></pre>
  
  <p>It does the job, however now I have to press the back button multiple times to go back.</p>
  
  <p>Why is it so?</p>