我添加了以下手势识别器:
UIPanGestureRecognizer *d2 = [[UIPanGestureRecognizer alloc]
initWithTarget:self
action:@selector(ViewDragging2:)];
[d2 setMinimumNumberOfTouches:2];
[d2 setMaximumNumberOfTouches:2];
[targetView addGestureRecognizer:d2];
发生该事件时触发的方法是:
-(void)ViewDragging2:(UIPanGestureRecognizer*)sender {
// some point
CGPoint translatedPoint = [(UIPanGestureRecognizer*)sender translationInView:targetView];
}
即使我用两根手指触摸,这也让我一触即发。如何找回第一次和第二次触摸的绳索?