Last active
December 15, 2015 02:08
-
-
Save inailuy/5184588 to your computer and use it in GitHub Desktop.
check which tableview cell was long pressed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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