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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:25:14+00:00 2026-05-25T16:25:14+00:00

Im working on an app with zooming function. In this app I have this

  • 0

Im working on an app with zooming function.
In this app I have this button. I want it to respond to tapping in several ways:

Single tap: Zoom in slightly.

Double tap: Zoom in to the max.

Ive tried several options to achieve this but none are what I want.

UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapGesture:)];
tapGesture.numberOfTapsRequired = 2;
[self.view addGestureRecognizer:tapGesture];

[zoomin addTarget:self action:@selector(zoominMax) forControlEvents:UIControlEventTouchDownRepeat];

Both work on single and double tap but when I press the button once to slightly zoom and seconds later I press it again it doesn’t zoom in slightly, it zooms in to the max.

It is possible to fix this with a timer and location check so that when u tap and tap again u can be sure that the location is in a similar area and the taps happened within timer range.

But is this what I really need?
Is there a simpler solution?

  • 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-25T16:25:14+00:00Added an answer on May 25, 2026 at 4:25 pm

    You can do it with two gesture recognizers and a timer:

    UITapGestureRecognizer *tapGestureRecognizer = [[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tap:)] autorelease];
    [myView addGestureRecognizer:tapGestureRecognizer];
    
    UITapGestureRecognizer *doubleTapGestureRecognizer = [[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(doubleTap:)] autorelease];
    doubleTapGestureRecognizer.numberOfTapsRequired = 2;
    [myView addGestureRecognizer:doubleTapGestureRecognizer];
    

    You’ll have to use a slight delay in your tap: action before zooming in slightly because the first tap could be followed by a second tap:

    - (void)tap:(UITapGestureRecognizer *)recognizer
    {
        [self performSelector:@selector(singleTap) withObject:nil afterDelay:0.25];
    }
    
    - (void)singleTap
    {
        //slightly zoom in...
    }
    
    - (void)doubleTap:(UITapGestureRecognizer *)recognizer
    {
        //Cancel the timer for the single tap action:
        [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(singleTap) object:nil];
        //zoom in to the max zoom level...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hello In my app I have a PayPal Pay Now button (working on Sandbox
Suppose I have this simple app working : # model class Project has_many :numbers
I'm working on an app that requires no user input, but I don't want
I am working with Google App Engine and Python. I have a model with
I have a working app in lwjgl. It doesn't do much yet; I've just
I have a working android app using TextView, some formatting (line breaks, rows of
i m working on app,in which user taps to shoot bullets, i want user
I'm trying to get an ASP.NET MVC app working... I should have known it
Greetings! I have a working iPhone app (huzzah!) that uses a MainView.xib containing a
Here's the deal, I had this app working since iPhone OS 3.0 came out,

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.