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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:22:48+00:00 2026-05-26T17:22:48+00:00

How do you forcibly cancel a zooming open pinch gesture on a UIScrollView ,

  • 0

How do you forcibly cancel a zooming open pinch gesture on a UIScrollView, say when the user has zoomed “sufficiently” far to trigger a new action?

  • 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-26T17:22:49+00:00Added an answer on May 26, 2026 at 5:22 pm

    To prevent user-controller zooming and panning but still allow programmatic zooming and panning of a scrollview, the best approach is to override the UIScrollView's –addGestureRecognizer: method in a subclass.

    -(void)addGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer
    {
        //Prevent any of the default panning and zooming controls from working
        gestureRecognizer.enabled = NO;
        [super addGestureRecognizer:gestureRecognizer];
        return;
    }
    

    Each gesture recognizer is simply disabled, for finer control (for ex. allowing the pan control but only allow zooming via a double tap for instance) you’d simply check the incoming gesture recognizer via -isKindOfClass: and disabling as appropriate.

    -(void)addGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer 
    {
        //Prevent zooming but not panning
        if ([gestureRecognizer isKindOfClass:[UIPinchGestureRecognizer class]]) 
        {
            gestureRecognizer.enabled = NO;
        }
        [super addGestureRecognizer:gestureRecognizer];
        return;
    }
    

    Hope this helps.

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

Sidebar

Related Questions

I need to quickly (and forcibly) kill off all external sessions connecting to my
First I chmod +x to these following files forcibly, and when I tried to
I've been getting Connection forcibly closed errors and in researching a resolution, I have
What is the SQL command to forcibly close all other connections to the a
I have never programmed VB, but a university course forcibly requires me to use
I am printing to a thermal ticket printer which has no standard drivers. Traditionally
I create a new blank form and the tried to switch to design mode
I a WPF/C# application that has a psuedo-process of Click a button > Start
I'm seeing a ton of these errors An existing connection was forcibly closed by
I'm working on a website (say, www.domain.com ) and want to release part of

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.