Hi how do I locate both the cgpoint? he gives me just one.
-(void)gestureLoad {
//GESTURE
UIGestureRecognizer *recognizer;
recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(numTap2:)];
[(UITapGestureRecognizer *)recognizer setNumberOfTouchesRequired:2];
[self.view addGestureRecognizer:r开发者_开发知识库ecognizer];
self.tapRecognizer = (UITapGestureRecognizer *)recognizer;
recognizer.delegate = self;
[recognizer release];
}
- (void)numTap2:(UITapGestureRecognizer *)recognizer {
CGPoint location = [recognizer locationInView:self.view];
...other actions...
}
thanks a lot!
From the description of -[UIGestureRecognizer numberOfTouches]:
Using the value returned by this method in a loop, you can ask for the location of individual touches using the locationOfTouch:inView: method.
So, call -locationOfTouche:inView: for each touch to get the corresponding location.
精彩评论