Skip to content

Instantly share code, notes, and snippets.

@inailuy
Last active December 15, 2015 02:08
Show Gist options
  • Save inailuy/5184588 to your computer and use it in GitHub Desktop.
Save inailuy/5184588 to your computer and use it in GitHub Desktop.
check which tableview cell was long pressed
CGPoint p = [gestureRecognizer locationInView:self.tableView];
NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:p];
if (gestureRecognizer.state == UIGestureRecognizerStateBegan)
{
if (indexPath == nil)
{
NSLog(@"long press on table view but not on a row");
}
else
{
NSLog(@"long press on table view cell %i", indexPath.row);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment