2

I use the MMdrawercontroller in my objective-c application for the left menu. I have in the navBar a button to open/close the menu. The problem is that the menu is only opened and not closed. This is my code:

- (IBAction)showMenu:(id)sender {
    AppDelegate * app = (AppDelegate *) [[UIApplication sharedApplication] delegate];
    [app.drawerController toggleDrawerSide:MMDrawerSideLeft animated:true completion:nil];
  }

EDIT: The IBAction is never called when the menu is opened (even if, when I debug, there is no view covering my centerVC)

Ne AS
  • 1,490
  • 3
  • 26
  • 58
  • have you verified that the code is called when you tap the button while the drawer is open and that app.drawerController is not nil? – Aris Jan 23 '17 at 11:25
  • @Aris When I tap the button while the drawer is open, the code is not called at all – Ne AS Jan 23 '17 at 11:29
  • You will need to check to see if something is removing the action from the button when the drawer is shown, or if for some reason you are re-adding the button, without the action. – Aris Jan 23 '17 at 11:32
  • @Aris How can I check this please? – Ne AS Jan 23 '17 at 11:33
  • I guess you will have to go through the code and see what happens when the drawer is displayed. – Aris Jan 23 '17 at 11:34

1 Answers1

0

I called below code to reveal menu:

#pragma mark- REVEALMENU

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

}

- (IBAction)revealUnderRight:(id)sender
{
    [self.mm_drawerController toggleDrawerSide:MMDrawerSideRight animated:YES completion:nil];

}
Anil Gupta
  • 1,155
  • 1
  • 19
  • 26