0

I am junior iOS dev and trying to use MMDrawerController.

I have MainStoryboard with 4 views.

  • NavigationController (embed on CenterViewController controller)
  • CenterViewController
  • LeftViewController
  • AboutViewController

I've added button on Navigation left item on CenterViewController and tap on it open/close my sidemenu.

But if I wan't to change center view with this code

ViewController *vc = [mainStoryboard instantiateViewControllerWithIdentifier:@"AboutViewController"];
                if (vc)
                    [appDelegate.drawerController setCenterViewController:vc withCloseAnimation:YES completion:nil];

It works fine but I have no navigation left button. Why?

Thanks

Nirav Kotecha
  • 2,493
  • 1
  • 12
  • 26
Boris Kuzevanov
  • 1,232
  • 1
  • 12
  • 21

1 Answers1

0

My solution is:

AboutViewController *vc = [mainStoryboard instantiateViewControllerWithIdentifier:@"AboutViewController"];
            if (vc)
            {
                if ( [appDelegate.drawerController.centerViewController isKindOfClass:[UINavigationController class]] )
                {
                    [tableView deselectRowAtIndexPath:indexPath animated:YES];
                    UINavigationController *navController = (UINavigationController *)appDelegate.drawerController.centerViewController;
                    [appDelegate.drawerController toggleDrawerSide:MMDrawerSideLeft animated:YES completion:nil];
                    [navController pushViewController:vc animated:YES];
                }
            }
Boris Kuzevanov
  • 1,232
  • 1
  • 12
  • 21