I've attached a UITabGestureRecognizer to my table view in order to detect tabs on certain location.
- (void)cellTapped:(UITapGestureRecognizer *)gesture
{
CGPoint tapLocation = [gesture locationInView:self.tableView];
if(tapLocation.x > 95)
{
NSIndexPath *swipedIndexPath = [self.tableView indexPathForRowAtPoint:tapLocation];
ItemCell *cell = (ItemCell *)[self.tableView cellForRowAtIndexPath:swipedIndexPath];
[cell toggleCell:YES fromTap:YES];
}
}
Here I check the x location of the tab, only when this location is above 95 the toggleCell function should be executed, otherwise the gesture should be cancelled.
While this works fine, the buttons in the cell are really hard to click. These buttons are location on the left from the 95 x point. (hence why i check the location)
It seems I have to hold the buttons for a second before they are actually clicked, does this have something to do with the tap gesture? (When I remove it, it all works normal)
So here the green area would be clickable.
The solution was to attach the gestures separately in the cell itself and listen to different notifications.