Push View from Presented View Controller in iOS
<p><strong>In Short :</strong>
How can I PushViewController from Presented ViewController ?</p>

<p><strong>In Brief :</strong></p>

<p>I have <code>MainViewController</code>, In which I have one button on click of button, I am presenting a view called <code>LoginViewController</code>.</p>

<p>On this page (<code>LoginViewController</code>), I again have <code>button</code>, on click of that, I try to push my view controller(called <code>HomeViewController</code>) it doesn't pushes.</p>

<p>Here is my code snippet,</p>

<p><strong>MainViewController.m</strong></p>

<pre><code>- (IBAction)LoginClicked:(id)sender {
    LoginViewController *vc = [[LoginViewController alloc] init];
    [self presentViewController:vc animated:YES completion:nil];
}
</code></pre>

<p><strong>LoginViewController.m</strong></p>

<pre><code>- (IBAction)buttonActionMethodOnLoginView:(id)sender{
     NSLog(@"viewControllers %@",APPDELEGATE.nav.viewControllers);
     //LoginViewController is not in this array
     HomeViewController *obj = [[HomeViewController alloc] init];
     [self.navigationController pushViewController:obj animated:YES];
}
</code></pre>

<p>But it did not works for me. Also, I printed <code>a stack of view controllers</code> before <code>pushed</code>, but it doesn't have <code>LoginViewController</code>. So, without adding <code>LoginViewController</code> into <code>a stack of view controllers</code>, How can I <code>pushed</code> to <code>HomeViewController</code> from <code>LoginViewController</code> ?</p>

<p><strong>When I getBack from <code>HomeViewController</code>, then <code>LoginViewController</code> should get opened..</strong></p>

<p>Is it possible using doing this single <code>NavigationController</code>?</p>

<p><strong>Note:-</strong> Here, I have just taken an example using Login, Home and Main ViewController. But I want that into Other Screens.</p>