iphone中的手势识别器

iphone中的手势识别器,iphone,Iphone,我知道在ios中处理手势,但是否可以为动作实现DoubleTap手势? 这意味着 UISwipeGestureRecognizer *swipeGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeGesture:)]; swipeGesture.direction = UISwipeGestureRecognizerDirectionRight; // or

我知道在ios中处理手势,但是否可以为动作实现DoubleTap手势? 这意味着

UISwipeGestureRecognizer *swipeGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeGesture:)];
    swipeGesture.direction = UISwipeGestureRecognizerDirectionRight; // or whatever
    [table addGestureRecognizer:swipeGesture];
    [swipeGesture release];
    UISwipeGestureRecognizer *swipeGestureleft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeGestureleft:)];
    swipeGestureleft.direction = UISwipeGestureRecognizerDirectionLeft; // or whatever
    [table addGestureRecognizer:swipeGestureleft];
    [swipeGestureleft release];
我们可以通过这种方式进行左右滑动,但我希望DoubleTap手势可以执行类似上述代码的操作。
提前谢谢

您可以为此配置UITapgestureRecognitor:

UITapGestureRecognizer *dblTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleDoubleTap:)];
dblTap. numberOfTapsRequired = 2;
[table addGestureRecognizer:dblTap];
[dblTap release];

很好,它可以工作,还有一个疑问,我可以为一个操作执行sipeRightHold吗?也就是说,向右滑动,然后为另一个操作执行hold?谢谢。不清楚您想要什么。。。检查文档,可能是UILongPressGestureRecognitor是您需要的吗?。。