mikefrederick / MFSideMenu

Facebook-like side menu for iOS
Other
1.17k stars 291 forks source link

How can I disable PanMode some specific area? #157

Open HemalAsanka opened 10 years ago

HemalAsanka commented 10 years ago

I have to a view controller and I need to enable pan mode in it. I did it like this -(void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; self.menuContainerViewController.panMode=MFSideMenuPanModeDefault;//enable pan mode only rootview controller } But I need to add UISlider on that view controller. So I want to disable pan mode on only that area. Otherwise UISlider not work on smoothly. How can I do that?

mikefrederick commented 10 years ago

@HemalAsanka unfortunately right now there is not a great way to do this.

bendigi commented 9 years ago

I solved the issue with UISliders this way:

In MFSideMenuContainerViewController.m find the method with the signature.

(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch

Add the following at the beginning.

    if ([touch.view isKindOfClass:[UISlider class]]) {
        return NO;
    }

and you are Golden!