I want to perform one action if the user made a single touch and another if a user made a double touch on a UITableView Cell.
I tried multiple approaches mentioned in this question.
How can I detect a double tap on a certain cell in UITableView?
But every approach, I cannot distinguish single tap and double correctly. What I meant is, in each double tap, it happens a single tap also. So, double tap happens, every time single tap action also fired.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
FeedCell *myCell = (FeedCell*) [self.tblView cellForRowAtIndexPath:indexPath];
NSLog(@"clicks:%d", myCell.numberOfClicks);
if (myCell.numberOfClicks == 2) {
NSLog(@"Double clicked");
}
else{
NSLog(@"Single tap");
}
}
What should be the correct way to do this?