我在view& amp;添加了longpressGesture识别器鉴于NoofTouchesRequired=2
。我想得到我所说的两个观点的坐标。
MyCode如下: -
//---long press gesture---
UILongPressGestureRecognizer *longpressGesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector (handleLongpressGesture:)];
longpressGesture.minimumPressDuration = 4;
longpressGesture.numberOfTouchesRequired = 2;
[viewLongPress addGestureRecognizer:longpressGesture];
[longpressGesture release];
答案 0 :(得分:1)
UIGestureRecognizer
只有locationInView:
方法。
答案 1 :(得分:1)
-(void)handleLongpressGesture:(UIGestureRecognizer *)reco{
UIView *theSuperview = self.view;
CGPoint touchPointInSuperview = [reco locationInView:theSuperview];
}