长按获取indexPath

  • (void)longPressMethod:(UILongPressGestureRecognizer *)gesture {
    CGPoint point = [gesture locationInView:self.tableView];
    NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:point];
    if (gesture.state == UIGestureRecognizerStateBegan) {
    NSLog(@"%@",indexPath);
    }
    }

你可能感兴趣的:(长按获取indexPath)