hi I have this recognizer installed with 2 touches, but it returns only one, not two CGPoint
-(void)gestureLoad {
UIGestureRecognizer *recognizer;
recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(numTap2:)];
[(UITapGestureRecognizer *)recognizer setNumberOfTouchesRequired:2];
[self.view addGestureRecognizer:recognizer];
self.tapRecognizer = (UITapGestureRecognizer *)recognizer;
recognizer.delegate = self;
[recognizer release];
}
- (void)numTap2:(UITapGestureRecognizer *)recognizer {
CGPoint location = [recognizer locationInView:self.view];
NSLog(@"x %f y %f",location.x, location.y);
}
as I understand it, I cyclically switch the number of touches in these two ways, but I did not understand how:
-(CGPoint)locationOfTouch:(NSUInteger)touchIndex inView:(UIView *)view {
}
-(NSUInteger)numberOfTouches {
}
Many thanks!
Vins source
share