I am trying to understand how this is done correctly. I tried to portray the situation: 
I am adding a UITableView as a subitem of a UIView . UIView responds to tap- and pinchGestureRecognizer , but at the same time tableview stops responding to these two gestures (it still responds to swipes).
I did this to work with the following code, but this is obviously not a good solution, and I'm sure there is a better way. This is placed in a UIView (supervisor):
-(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { if([super hitTest:point withEvent:event] == self) { for (id gesture in self.gestureRecognizers) { [gesture setEnabled:YES]; } return self; } for (id gesture in self.gestureRecognizers) { [gesture setEnabled:NO]; } return [self.subviews lastObject]; }
ios objective-c uiview uigesturerecognizer uiresponder
andershqst Mar 07 '11 at 17:32 2011-03-07 17:32
source share