I am trying to add a left and right swipe gesture to every cell in my UITableView. However, no one has seemed to answer this question no matter where I look. Using this current solution, which is what is recommended, I do not enter the right gesture handler.
UISwipeGestureRecognizer* right = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeRight:)];
right.direction = UISwipeGestureRecognizerDirectionRight;
[self.tableView addGestureRecognizer:right];
UISwipeGestureRecognizer* left = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeLeft:)];
left.direction = UISwipeGestureRecognizerDirectionLeft;
[self.tableView addGestureRecognizer:left];
I create two different Gesture recognizers for my solution. However, I can never see a response from the right UIGestureRecognizer. I don't understand why I never see a response from the right gesture recognizer only left one.
-(void)swipeLeft:(UISwipeGestureRecognizer*)gestureRecognizer
{ NSLog("You have swiped Left");
}
-(void)swipeRight:(UISwipeGestureRecognizer*)gestureRecognizer
{ NSLog("You have swiped right"); //Never Enter this handler
}
Use this code...
I hope you don't mind its in swift.