I am using a custom subclass of UIGestureRecognizer to track gestures in my InfoView class. The InfoView class is a subheading of a custom subclass of UITableViewCell called InfoCell .
I added my gesture recognizer to my root mode (the parent view of everything else on the screen, because the goal of my custom gesture recognizer is to let InfoCell drag and drop views between tables). Now everything works as it should, except for one. I use the following code in a subclass of UIGestureRecognizer to detect touches in an InfoView :
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UIView *touchView = [[touches anyObject] view]; if ([touchView isKindOfClass:[InfoView class]]) {
The problem is that the touches of the InfoView object are intercepted, so they are not forwarded to the UITableView , which contains InfoCell , which is the parent view of InfoView . This means that I can no longer scroll the table view by dragging and dropping the InfoView view, which is a problem because the InfoView spans the entire InfoCell .
Is there any way to move the touches to the table view so that it can scroll? I already tried a bunch of things:
[super touchesBegan:touches withEvent:event];
[touchView.superview.superview touchesBegan:touches withEvent:event]; ( touchView.superview.superview gets a link to its parent UITableView )
But so far nothing has happened. In addition, the cancelsTouchesInView property of my UIGestureRecognizer set to NO , so it does not interfere with touches.
Help is appreciated. Thanks!
cocoa-touch ipad uiview uigesturerecognizer
indragie
source share