MMDrawerController with storyboard

in my project, I would like to use the MMDrawerController plugin ( https://github.com/mutualmobile/MMDrawerController ), but I have a problem. I use a storyboard in the project, so I read this post http://pulkitgoyal.in/side-drawer-navigation-for-ios/ , but the plugin does not work.

I have a root view controller that calls another view (box) using segue and therefore uses this method (as indicated in the manual).

-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  if ([segue.identifier isEqualToString:@"DRAWER_SEGUE"]) {
    MMDrawerController *destinationViewController = (MMDrawerController     *)segue.destinationViewController;

    // Instantitate and set the center view controller.
    UIViewController *centerViewController = [self.storyboard     instantiateViewControllerWithIdentifier:@"FIRST_TOP_VIEW_CONTROLLER"];
[destinationViewController setCenterViewController: centerViewController];

// Instantiate and set the left drawer controller.
UIViewController *leftDrawerViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"SIDE_DRAWER_CONTROLLER"];
[destinationViewController setLeftDrawerViewController: leftDrawerViewController];
  }
}

When the destination view is loaded, I only see the centerView without the side box controller. Why?

Thanks in advance.

+4
source share
1 answer

?

.

- (IBAction)menuTapped:(id)sender {
[self.mm_drawerController toggleDrawerSide:MMDrawerSideLeft animated:YES completion:nil];
}

.

EDIT: ViewDidLoad,

self.mm_drawerController.openDrawerGestureModeMask = MMOpenDrawerGestureModePanningCenterView;
self.mm_drawerController.closeDrawerGestureModeMask = MMCloseDrawerGestureModePanningCenterView;

.

+3

Source: https://habr.com/ru/post/1534683/


All Articles