获取添加了longpressGesture识别器的视图坐标

时间:2013-12-25 06:31:31

标签: ios uigesturerecognizer

我在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];

2 个答案:

答案 0 :(得分:1)

UIGestureRecognizer只有locationInView:方法。

答案 1 :(得分:1)

-(void)handleLongpressGesture:(UIGestureRecognizer *)reco{
    UIView *theSuperview = self.view;
    CGPoint touchPointInSuperview = [reco locationInView:theSuperview];
}