Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7446969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:28:38+00:00 2026-05-29T12:28:38+00:00

I have 3 UIGestureRecognizers attached to a view: one finger double tap, two fingers

  • 0

I have 3 UIGestureRecognizers attached to a view: one finger double tap, two fingers double tap and one finger triple tap. The problem is this: when I triple tap, it fires the method that should be fired by double tap then the method for triple tap.

This is how I added it.

// one finger double tap
doubleTap = [[[UITapGestureRecognizer alloc]
              initWithTarget:self 
              action:@selector(handleDoubleTap:)] autorelease];
[doubleTap setCancelsTouchesInView:YES];
[doubleTap setNumberOfTapsRequired:2];
[doubleTapDoisDedos setNumberOfTouchesRequired:1];
[doubleTap setDelegate:self];
[[[CCDirector sharedDirector] openGLView] addGestureRecognizer:doubleTap];  


// two fingers double tap
twoFingerDoubleTap = [[[UITapGestureRecognizer alloc]
              initWithTarget:self 
              action:@selector(handleDoubleTapTwoFingers:)] autorelease];
[twoFingerDoubleTap setCancelsTouchesInView:YES];
[twoFingerDoubleTap setNumberOfTapsRequired:2];
[twoFingerDoubleTap setNumberOfTouchesRequired:2];
[twoFingerDoubleTap setDelegate:self]; 
[[[CCDirector sharedDirector] openGLView] addGestureRecognizer:twoFingerDoubleTap]; 



// triple tap com um dedo faz as cartas se empilharem
tripleTapOneFinger = [[[UITapGestureRecognizer alloc]
              initWithTarget:self 
              action:@selector(handleTripleTap:)] autorelease];
[tripleTapOneFinger setCancelsTouchesInView:YES];
[tripleTapOneFinger setNumberOfTapsRequired:3];
[tripleTapOneFinger setNumberOfTouchesRequired:1];
[tripleTapOneFinger setDelegate:self]; 
[[[CCDirector sharedDirector] openGLView] addGestureRecognizer:tripleTapOneFinger];

and yes, I have tried to add these, without success

[doubleTap requireGestureRecognizerToFail:doubleTapTwoFingers];   
[doubleTap requireGestureRecognizerToFail:tripleTapOneFinger];  

[doubleTapTwoFingers requireGestureRecognizerToFail:doubleTap];   
[doubleTapTwoFingers requireGestureRecognizerToFail:tripleTapOneFinger];  

[tripleTapOneFinger requireGestureRecognizerToFail:doubleTap];   
[tripleTapOneFinger requireGestureRecognizerToFail:doubleTapTwoFingers];  

what am I missing?

is there a way to, inside the handle method, detect the number of taps?

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T12:28:39+00:00Added an answer on May 29, 2026 at 12:28 pm

    Adding too many gesture recognizer dependancies through requireGestureRecognizerToFail: will cause problems. Just add the one dependency that is needed, in your case:

    [doubleTap requireGestureRecognizerToFail:tripleTapOneFinger]; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two types of recognizer, one for tap and one for swipe UIGestureRecognizer
Have deployed numerous report parts which reference the same view however one of them
have a problem. At first look at this HTML <div id=map style=background-image: url(map.png); width:
I have button created programmatically in the UIImageView. This view was also created programmatically.
I have a swipe recognizer attached to cells in my table view - (UITableViewCell
I have written a custom UIGestureRecognizer which handles rotations with one finger. It is
I have a pinch gesture recognizer attached to my scrollView (one on top of
I currently have this in my code tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(updateLeftLabel:)]; which
I have a UITapGesture attached to an image view. I'd like to reuse the
In my project, i have two views. One is homeViewController and other is searchViewController.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.