Search code examples
iosobjective-cxcodeamslidemenu

Xcode AMSlideMenu disable menu in some screens


https://github.com/SocialObjects-Software/AMSlideMenu

in some screens need to disable slide menu and implement UInavigationbar button for other action

it's possible?

thanks


Solution

  • To set menu button to your own, place the following code in a view controller:

        UIBarButtonItem *anotherButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"back_button"]
                                                                      style:UIBarButtonItemStylePlain
                                                                     target:self
                                                                     action:@selector(action:)];
    
        self.navigationController.navigationBar.topItem.leftBarButtonItem = anotherButton;
    

    To ndisable pan gesture in view controller, then just import "UIViewController+AMSlideMenu.h" and call [self disableSlidePanGestureForLeftMenu];