Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kevinkirkup/3905359 to your computer and use it in GitHub Desktop.
Save kevinkirkup/3905359 to your computer and use it in GitHub Desktop.
Get UITableViewCell from UIGestureRecognizer
// Add the UIGestureRecognizer to the UITableView in viewDidLoad:
-(void)didSwipe:(UIGestureRecognizer *)gestureRecognizer {
if (gestureRecognizer.state == UIGestureRecognizerStateEnded) {
CGPoint swipeLocation = [gestureRecognizer locationInView:self.tableView];
NSIndexPath *swipedIndexPath = [self.tableView indexPathForRowAtPoint:swipeLocation];
UITableViewCell* swipedCell = [self.tableView cellForRowAtIndexPath:swipedIndexPath];
// ...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment