I am adding a gesture to the cell like this
UILongPressGestureRecognizer *gesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleGestureSection:)];
[gesture view].tag = indexPath.row;
gesture.minimumPressDuration = 0.5;
gesture.allowableMovement = 600;
[cell addGestureRecognizer:gesture];
and I am trying to get the indexPath.row
(void)handleGestureSection:(UIGestureRecognizer *)gesture {
if (gesture.state == UIGestureRecognizerStateEnded) { NSLog(@"Long press Ended");
} else if (gesture.state == UIGestureRecognizerStateBegan) { NSInteger i = [gesture view].tag; } }
But is always returning 0. What am I doing wrong?