I have a custom complex UITableViewCell where there are many views. I have an UIImageView within it which is visible for a specific condition. When it\'s visible ,
Add the gesture recognizer to the cell itself.
Then in the action selector, do as following to know which view has been tapped:
-(IBAction)cellTapped:(UITapGestureRecognizer*)tap
{
MyCustomTableViewCell* cell = tap.view;
CGPoint point = [tap locationInView:cell.contentView];
UIView* tappedView = [cell.contentView hitTest:point withEvent:NULL];
if (tappedView==cell.myImageView) {
// Do whatever you want here,
}
else { } // maybe you have to handle some other views here
}