title: How to push from view controller to navigation view controller using prepareForSegue method?
body: <p>I have a project which has a view controller as initial screen and then a view controller embedded inside a navigational view controller. I also have a button on first screen on click of which I want the navigational controller screen to be opened.</p>
  <p>I clicked on button and then on ' connections inspector', I added push event to that navigational controller, but segue is not happening. How could I achieve it please?</p>
  <h1>SOLUTION</h1>
  <p>Finally after a bit of research I managed to get this thing working. Here is the code i am using:</p>
  <pre><code>- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
  {
      NSLog(@&quot;Source Controller = %@&quot;, [segue sourceViewController]);
      NSLog(@&quot;Destination Controller = %@&quot;, [segue destinationViewController]);
      NSLog(@&quot;Segue Identifier = %@&quot;, [segue identifier]);
      
      if ([segue.identifier isEqualToString:@&quot;mysegue&quot;])
      {
          NSLog(@&quot;coming here&quot;);
          
       SecondViewController *loginViewController = (SecondViewController *)segue.destinationViewController;
          
         //SecondViewController *navigationController = [[UINavigationController alloc]init];
          
          [self presentModalViewController:loginViewController animated:YES];
          
          
      }
      
  }
  </code></pre>