I have a UITextView subclass that has an NSIndexPath
property that is inside a UITableViewCell
. When you tap on it, I'd like to be able to call didSelectRowAtIndexPath
.
Here's what I have:
UITapGestureRecognizer *singleFingerTap =
[[UITapGestureRecognizer alloc] initWithTarget:self action:nil];
[theTextView addGestureRecognizer:singleFingerTap];
singleFingerTap.delegate = self;
....
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
CustomTextView *theTextView = (CustomTextView *)touch.view;
NSLog(@"%@", theTextView.indexPath);
return YES;
}
I see from this question, I may even have to break up my didSelectRowAtIndexPath
logic, which is fine. And I already know the index path of the view that was tapped.
What is the proper way to call this tableView method (or what didSelectRowAtIndexPath
would do) from within the gesture recognizer method?