Hi, I have a simple UIView used like container. If I write this code:
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
UIView *hitView = [super hitTest:point withEvent:event];
NSSet *sTouches = [event touchesForView:self];
NSLog(@"Touches %d", [sTouches count] );
return self;
}
Doesn't work! I would like get touches count in hitTest() message, before touchesBegan()! Is it possible?
I have this hierarchy:
UIView
+---> UIScrollView
When touch on my UIView
(single tap) the container moves. When I double touch (two finger) on my UIView
, the child UIScrollView
doesn't work for Zoom (for example).
So I have think to catch touches number.
If touch number is equal to one, hitTest
on my UIView
container return "self".
Else, if touch number is great to one ( == 2), hitTest
return "scrollview" pointer.
In others words, I would like catch two finger event into hitTest() message/event.