title: How to add a UIViewController as a subview to a UIViewController(RootViewController)?
body: <p>I have a <code>UIViewController</code> named <code>LoginViewController</code>, and it is a <code>rootViewController</code> in the <code>AppDelegate</code>. In the <code>LoginViewController</code>, I have two buttons: <code>Login</code> and <code>Enroll</code>. </p>
  
  <p>When I tap <code>Login</code>, I assign a <code>TabBarController</code> as the <code>rootViewController</code>, then show the <code>TabBarController</code>. However, now I think I need to add another <code>UIViewcController</code> as a subview when I tap <code>Enroll</code>. I tried the following:</p>
  
  <pre><code>[self.view addsubview:viewcontroller.view];
  </code></pre>
  
  <p>But the problem here is <strong>My ViewController's view.top is pinned about 20 pixels below the top of the screen</strong>. I think there is an issue with the status bar, but I can't figure out how to fix it. </p>
  
  <p><strong>I think that I need to add my ViewController as a subview to the LoginViewController</strong>, then redirect from there to different views. Can someone please suggest other options?</p>