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 7971309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:36:34+00:00 2026-06-04T07:36:34+00:00

Heres the code where im adding the gesture recognizers UIImage *img = [UIImage imageWithContentsOfFile:media.thumbnailPath];

  • 0

Heres the code where im adding the gesture recognizers

    UIImage *img = [UIImage imageWithContentsOfFile:media.thumbnailPath];
    UIImageView *imageView = [[UIImageView alloc] init];  
    imageView.image = img;  
    imageView.contentMode = UIViewContentModeScaleToFill;
    imageView.backgroundColor =[UIColor blackColor];  

    //Add tap guesture
    UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)];
    UITapGestureRecognizer *doubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleDoubleTap:)];

    [singleTap setNumberOfTapsRequired:1];
    [singleTap setDelegate:self];

    [doubleTap setNumberOfTapsRequired:2];
    [doubleTap setDelegate:self];

    [singleTap requireGestureRecognizerToFail:doubleTap];

    [imageView addGestureRecognizer:singleTap];
    [imageView addGestureRecognizer:doubleTap];
    [singleTap release];
    [doubleTap release];

and i have implemented the

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
     NSLog(@"Gesturing");
     return YES;
}

but the delegate method is not called when dealing with the singletap gesture but it works for doubletap gesture

  • 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-06-04T07:36:35+00:00Added an answer on June 4, 2026 at 7:36 am

    Check out Simultaneous gesture recognizers in Iphone SDK

    For most cases you don’t need to:

    setup a delegate
    permit simultaneous gesture recognition (unless you want simultaneous swipes; not likely)
    

    Setting Gesture Recognizers

    UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] 
                                         initWithTarget:self 
                                         action:@selector(handleSingleTapOnMainImageView:)];
    
    [imageView addGestureRecognizer:singleTap];
    [singleTap release];
    
    UITapGestureRecognizer *doubleTap = [[UITapGestureRecognizer alloc] 
                                         initWithTarget:self 
                                         action:@selector(handleDoubleTapOnMainImageView:)];
    [doubleTap setNumberOfTapsRequired:2];
    [singleTap requireGestureRecognizerToFail:doubleTap];
    [imageView addGestureRecognizer:doubleTap];
    [doubleTap release];
    

    Method implementation

    -(void)handleSingleTapOnMainImageView:(UIGestureRecognizer*)gestureView
    {
    NSLog(@"handleSingleTapOnMainImageView");
    }
    
    -(void)handleDoubleTapOnMainImageView:(UIGestureRecognizer*)gestureView
    {
    NSLog(@"handleDoubleTapOnMainImageView");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to get a url from a string. Heres my code to extract
I'm stuck on how to use the 'text-overflow' function. Heres my code: <style type=text/css>
Here's the code I use to load a texture. image is a CGImageRef. After
Here is my code for adding a row: grid.onAddNewRow.subscribe(function (e, args) { var item
How could i go about adding more containers to my Jframe? Heres my line
I created a my own SortedSet here is the code for adding something to
Heres the code on the jsp: <form id=commentForm name=commentForm action= method=post> <ctl:vertScroll height=300 headerStyleClass=data_table_scroll
hi i have a problem about adding data into two tables, heres the situation,
I'm using a UIRotationGestureRecognizer to rotate a UIImageView . By adding all small rotation
I got to a level where i am adding a shortcut via code to

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.