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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:20:06+00:00 2026-05-28T08:20:06+00:00

I have a pinch gesture recognizer attached to my scrollView (one on top of

  • 0

I have a pinch gesture recognizer attached to my scrollView (one on top of the default one). I’m trying to enable it and disable it at certain zoom levels but it is not working. I use the commands:

[self.pinchGesture setEnabled:NO];
and
[self.pinchGesture setEnabled:YES];

to enable and disable the pinch gesture. I am trying to debug it and I use this code to print out the description of my gestures:

NSArray *gestures = [self.scrollView gestureRecognizers];
for (UIGestureRecognizer *gesture in gestures) {
    NSLog(@"%s, gesture: %@", __FUNCTION__, [gesture description]);
}

I see that for my custom gesture it looks like:

gesture: <UIPinchGestureRecognizer: 0x88a62d0; state = Possible; enabled = NO; view = <UIScrollView 0x880c360>; target= <(action=handlePinch

So even though it is set to enabled = NO, the pinch still calls the handlePinch: method. Is there a reason for this? Or do I need to use the [self.scrollView setGestureRecognizers:<#(NSArray *)#> to remove that pinch gesture? If I am to go with that approach, do I have to loop through my gestures for the scrollView, save references to those, than set those so I don’t set back my custom pinch gesture? 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-28T08:20:07+00:00Added an answer on May 28, 2026 at 8:20 am

    The enabled scrollview just does that: enables and disables the scrollview. The Gesture Recognizers are a different animal, that are kind of latched into your scrollview, but behave almost independently. Why not remove the target for the gesture instead of disabling, then add the target back in when enabling? Alternatively, set a boolean that your target method checks and ignores the gesture when the boolean is YES.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a pinch gesture recognizer attached to an imageview from which I use
I have been trying to implement pinch zoom/in-out for PhotoView (a UIImageView instance) using
I have a map drawn with OpenGLES, and I have a pan gesture recognizer
I have an application that allow user to use the pinch gesture for scaling
Im trying to follow this article for having simultaneous pan and pinch gesture recognizers
I have an image, which can be moved around and scaled with pinch gesture..
For my application, i have used pinch zoom feature by adapting from the tutorial
I am trying to activate Pinch-Zoom in my app made on Jquery Mobile (Rhomobile
I have added the following gesture recognizer to my user control: UIRotationGestureRecognizer *rotate =
I have a 2d map that the user can zoom and pan using the

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.