Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable pan mode for certain view controllers in the MFSideMenu class?

I'm using the MFSideMenu from github link in my project. It's working, however I would like to disable it in a certain viewcontroller.

I added this in the viewcontroller but it doesn't disable the panMode:

#import "MFSideMenuContainerViewController.h"

-(void) viewWillAppear:(BOOL)animated {

    MFSideMenuContainerViewController *sideMenu = [[MFSideMenuContainerViewController alloc] init];

    sideMenu.panMode = 0;

}

my plan was then to re-enable the panmode in the viewDidDisappear method.

FYI in the MFSideMenuContainerViewController.m file if I add self.panMode = 0; to the - (void)setDefaultSettings {self.panMode = 0;} it does disable the menu pan except it disables it for the entire app of course.

I must not be referencing the MFSideMenuContainerViewController property panmode correctly.

in my AppDelegate:

.h

@property (nonatomic, strong) MFSideMenuContainerViewController *container;

.m

  MFSideMenuContainerViewController *container = [MFSideMenuContainerViewController
                                                    containerWithCenterViewController:self.navController
                                                    leftMenuViewController:nil
                                                    rightMenuViewController:rightSideMenuController];

    self.window.rootViewController = container;

thanks for any help

like image 362
hanumanDev Avatar asked May 21 '13 10:05

hanumanDev


1 Answers

You can use this in viewWillAppear.

[self.menuContainerViewController setPanMode:MFSideMenuPanModeNone];
like image 144
Pramod Kumar Pranav Avatar answered Oct 17 '22 01:10

Pramod Kumar Pranav