title: How within a tab bar controller do I segue from one view controller to another and retain the tab bar?
body: <p>I have an application with several view controllers controlled from a tab bar controller.  From one of these view controllers I want to (on clicking a button) segue to another view controller and retain the tab bar at the bottom of the segued to view.</p>
  
  <p>I've used </p>
  
  <pre><code>-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
      if ([segue.identifier isEqualToString:@"newView"]){
          UIViewController *controller =segue.destinationViewController;
          controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
          [self presentModalViewController:controller animated:YES];
      }
   }
  </code></pre>
  
  <p>This works fine except the tab bar is missing from the segued to view (a placeholder shows for it in the storyboard, but it doesn't show up when the app is run)
  I've also tried replacing</p>
  
  <pre><code>[self presentModalViewController:controller animated:YES];
  </code></pre>
  
  <p>with</p>
  
  <pre><code>[self presentViewController:controller animated:YES completion:nil];
  </code></pre>
  
  <p>but that doesn't work either.</p>
  
  <p>A bit of debugging shows that for the segued-to view controller, the tabBarController property is set to nil.</p>
  
  <p>Is there anyway to retain the tab bar in the segued-to view controller?</p>