0

I'm using CAPSPageMenu (https://github.com/PageMenu/PageMenu) in my app. I have side menu (ECSlidingViewController - https://github.com/ECSlidingViewController/ECSlidingViewController). Now if the side menu is opened I want to disable the swipe gesture of pagemenu and If user swipe the side menu should close. Currently what's happening is if side menu open and the user swipe pagemenu is changing page. How can we acheive this?

Here's the code to disable swipe in page menu

_pagemenu.controllerScrollView.scrollEnabled = NO;

How I tried is I wrote one call back in the side menu tap and I try to reload the pagemenu according to that. But it is not working.

if (self.menuCallBack) {
    _pagemenu.controllerScrollView.scrollEnabled = NO;
} else {
    _pagemenu.controllerScrollView.scrollEnabled = YES;
}

And how can avoid swipe after last page. I'm having 3 screens. If we swipe after 3rd screen it is showing some blank view how can we avoid this?

Any help could be appreciated. Thanks in advance.

1 Answers1

0

ECSlidingViewController is making use of Pan gesture for detecting the horizontal swipe. CAPS pagemenu uses scrollview. The ECSlidingViewController must not be receiving the gesture, even if scrollview is disabled on CAPSPageMenu class.

Try this code on your CAPSPagemenu class:

-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
    return YES;
}
Puneet Sharma
  • 9,369
  • 1
  • 27
  • 33