I have set up a gesture recognizer for my table cell in my IOS5 app:
UITapGestureRecognizer* oneFingerDoubleTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(cellOneFingerDoubleTap:)];
oneFingerDoubleTap.numberOfTapsRequired = 2;
[cell addGestureRecognizer:oneFingerDoubleTap];
And implemented handler method:
- (void)cellOneFingerDoubleTap:(id) sender
{
NSLog(@"taptap");
}
It works fine. My problem is that I can not pass the cell was tapped or some other data with the tapped cell. As I see (id)sender is the UITapGestureRecognizer itself.
My question is: how can I get the tapped cell in the handler method (cellOneFingerDoubleTap)? How can I get in the handler method the index of the tapped cell?
Thanks!
If you grab the
viewfrom the gesture recogniser that is passed in to you on yourcellOneFingerDoubleTap:method, then you’ll get the cell that’s been tapped. Something like:[I’m just assuming by a “cell” you mean a
UITableViewCellby the way]