0

I have right and left swipe recognizers on my view, as well as a table.There is a problem when user swipes left->right on the table view, table handle them and swipes table content instead of execution of left->right swipe recognizer methods. How do I increase the sensitivity of left->right swipe recognizers?

Here's the code for the recognizers:

UISwipeGestureRecognizer *swipeRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeRight)];

swipeRecognizer.numberOfTouchesRequired = 1;

swipeRecognizer.direction = UISwipeGestureRecognizerDirectionRight;

[self.view addGestureRecognizer:swipeRecognizer];

UISwipeGestureRecognizer *swipeRecognizer1 = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeLeft)];

swipeRecognizer1.direction = UISwipeGestureRecognizerDirectionLeft;

swipeRecognizer1.numberOfTouchesRequired = 1;

[self.view addGestureRecognizer:swipeRecognizer1];
Durandal
  • 5,575
  • 5
  • 35
  • 49
proh0r
  • 1
  • 1

2 Answers2

1

You can require one gestureRecognizer to fail before another one is invoked.

[lowerPriorityGestureRecognizer requireGestureRecognizerToFail:higherPriorityGestureRecognizer];
StephShelley
  • 114
  • 2
0

It would help greatly if you let us know whether the view is in/over/under the table rather than saying you have both a view and a table. That matters, alot.

Yangshun Tay
  • 49,270
  • 33
  • 114
  • 141