Search code examples
iosobjective-cuitableviewecslidingviewcontroller

ECSlidingViewController disabling swipe to delete in UITableView


I'm using this source code for adding a sliding menu similar to the Facebook App:

Git Hub Project ECSlidingViewController: https://github.com/edgecase/ECSlidingViewController

Here is the code for my Custom UINavigation Controller:

@implementation NavViewController

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];

    if (![self.slidingViewController.underLeftViewController isKindOfClass:[ZAPMenuViewController class]])
    {
        self.slidingViewController.underLeftViewController  = [self.storyboard instantiateViewControllerWithIdentifier:@"Menu"];
    }

    [self.view addGestureRecognizer:self.slidingViewController.panGesture];
}

However, I have a UITableView and I need to be able to swipe to delete. Is there a way to disable the panGesture when swiping the the left, but leave the panGesture for swiping to the right and revealing the menu?


Solution

  • Also check out some answers on ECSlidingViewController's wiki which include allowing simultaneous gestures to be recognized.

    - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer
     *)otherGestureRecognizer {
         if ([otherGestureRecognizer.view isKindOfClass:[UIScrollView class]]) {
             return YES;
         } else {
             return NO;
         } }