1

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

user1373316
  • 99
  • 1
  • 9

3 Answers3

1

AMSlideMenu provide some method to disable gesture :

- (void)addLeftMenuButton;
- (void)addRightMenuButton;
- (void)disableSlidePanGestureForLeftMenu;
- (void)disableSlidePanGestureForRightMenu;
- (void)enableSlidePanGestureForLeftMenu;
- (void)enableSlidePanGestureForRightMenu;

Just call disableslidegesture in your controller.

And change your navigationbar button target.

debug
  • 151
  • 6
1

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];

DarkSun
  • 451
  • 1
  • 7
  • 19
0

@DarkSun's answer seems correct for me. But in addition to it I wanted to mention that since iOS 8 you should call [self disableSlidePanGestureForLeftMenu]; in your ViewController's viewWillAppear function.

#import "UIViewController+AMSlideMenu.h"

-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self disableSlidePanGestureForLeftMenu];
}
Marcel Hofgesang
  • 951
  • 1
  • 15
  • 36