title: MVYSideMenu using Navigation Controller in all view controllers iOS
body: <p>I am using this Cocoa Control Side Menu <a href="https://www.cocoacontrols.com/controls/mvysidemenu" rel="nofollow">link</a>.</p>
  
  <p>In this Menu, when you start the app you have a Navigation Bar for the first screen, but when you open the menu and press any element of TableView, the ViewController change without Navigation Bar. I want to have a Navigation Bar for each of the elements of the TableView Menu and a left button on the Navigation bar that could open and close the Menu.</p>
  
  <p>I start the application with this code:</p>
  
  <p>// appDelegate.m</p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  {
      self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
      YPMenuViewController *menuVC = [[YPMenuViewController alloc] init];
      YPProfileViewController *contentVC = [[YPProfileViewController alloc] init];
      UINavigationController *contentNavigationController = [[UINavigationController alloc] initWithRootViewController:contentVC];
  
      YPSideMenuOptions *options = [[YPSideMenuOptions alloc] init];
      YPSideMenuController *sideMenuController = [[YPSideMenuController alloc] initWithMenuViewController:menuVC
                                                                                      contentViewController:contentNavigationController
                                                                                                    options:options];
      self.window.rootViewController = sideMenuController;    
      self.window.backgroundColor = [UIColor whiteColor];
      [self.window makeKeyAndVisible];
      return YES;
  }
  </code></pre>
  
  <p>After this, the app starts with Navigation bar.</p>
  
  <p>But then, in the TableView If Select the view controllers like this, I have the Navigation Bar but without button to open an close</p>
  
  <pre><code>    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  
          switch (indexPath.row) {
              case 0:
              {
                  YPProfileViewController *contentVC = [[YPProfileViewController alloc] init];
                  UINavigationController *contentNavigationController = [[UINavigationController alloc] initWithRootViewController:contentVC];
  
                  UIButton *iwantView = [[UIButton alloc] initWithFrame:CGRectMake(10, 10, 30, 30)];
                  [iwantView setBackgroundColor:[UIColor blackColor]];
                  [iwantView addTarget:self action:@selector(openMenu) forControlEvents:UIControlEventTouchUpInside];
  
                  contentNavigationController.navigationItem.leftBarButtonItem =[[UIBarButtonItem alloc] initWithCustomView:iwantView];
                  [[self sideMenuController] changeContentViewController:contentNavigationController closeMenu:YES];
                  break;
              }
           case 1:
                {
             YPProjectListViewController *contentVC = [[YPProjectListViewController alloc] init];
             UINavigationController *contentNavigationController = [[UINavigationController alloc] initWithRootViewController:contentVC];
              [[self sideMenuController] changeContentViewController:contentNavigationController closeMenu:YES];
              break;
                }
  
              default:{
                  YPProfileViewController *contentVC = [[YPProfileViewController alloc] init];
                  [[self sideMenuController] changeContentViewController:contentVC closeMenu:YES];
                  break;
              }
          }
  
      }
  </code></pre>