我已添加了以下手势识别器:
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];
}
即使我用两根手指触摸,也能实现单点触控。如何获取第一和第二个触摸的坐标?