title: Keep elements in Navigation Controller when segueing on iOS
body: <p>I am working on an app that displays a list of places. There is a NavigationController, and in the navigation bar I have some UIBarButtonItem (left and right), and the center section is a custom view with a label and two UIButton's.</p>
  
  <p><img src="https://i.stack.imgur.com/haDmk.png" alt="ToolBar"></p>
  
  <p>The map button performs a segue to a MapViewController that displays the points on a map. What I want to achieve is that the navigation bar of the map ViewController also displays the same custom UIView (showing the arrow buttons and the Day Label), but I don't know how to achieve this. I've tried to copy the view on prepareForSegue:</p>
  
  <pre><code>-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
      if ([segue.identifier isEqualToString:@"FlipFromListToMap"]) {
          if ([segue.destinationViewController isKindOfClass:[DisplayTourMapViewController class]]){
              DisplayTourMapViewController *cityListController = segue.destinationViewController;
  cityListController.navigationItem.titleView = self.navigationItem.titleView;
          }
      }
  }
  </code></pre>
  
  <p>But this is not working. Furthermore, when a go back the navigation view from the original table view is gone:</p>
  
  <p><img src="https://i.stack.imgur.com/nz3Rn.png" alt="Gone"></p>
  
  <p>I'd like to know whether my approach is wrong or not. Can I keep the navigationcontroller views between segues? Is it ok that I am using navigationcontroller and segue's? Or should I just have two views inside the controller and swap them programatically? The model for the two views is the same, it only changes the way I present the information (map or list).</p>
  
  <p>Thanks in advance.</p>