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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:47:42+00:00 2026-05-26T14:47:42+00:00

I was wondering if anyone knows how the UIPinchGestureRecognizer scale value is determined, or

  • 0

I was wondering if anyone knows how the UIPinchGestureRecognizer scale value is determined, or if there is a formula I could use to calculate a new scale value?

I have an app where I attach a UIPinchGestureRecognizer to an imageView, and in certain specific instances, I need to manually readjust a scale if it shrinks the imageView so it goes past a certain point of the screen. 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-26T14:47:43+00:00Added an answer on May 26, 2026 at 2:47 pm

    I found out what I needed by doing a little reverse engineering. As most of you know who have implemented a scale method with the UIPinchGestureRecognizer, you ultimately end up with this line of code:

    GFloat nextScale = 1 -  (previousScale - [sender scale]);
    

    This is the nextScale calculated on the value given by the UIPinchGestureRecognizer, however I needed to make my own custom scale since the user had scaled past the boundary I set up. So I determined the width I needed my imageview to be shrunk to, and determined the adjustedScale I needed by setting it up as a proportion: (nextScale / adjustedScale) = (nextWidth / adjustedWidth).

    Then I reinserted the adjustedScale into the above formula to determine what the [sender scale] would be for my new scale amount: [sender scale] = AdjustedScale – 1 – previousScale.

    So now I can use that amount to set the previousScale value which I’ll need for next time.

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

Sidebar

Related Questions

I was wondering if anyone knows how to use a new compiler within visual
I was wondering if anyone knows of a way to use the JQuery find
Hi i was wondering if anyone knows how i can calculate the difference between
just wondering if anyone knows anything of using javascript to set html to new
Just wondering if anyone knows if there are any MSBuild starter kits out there.
Just wondering if anyone knows of a jQuery sortable plugin that I can use
I was wondering if anyone knows of a combined Objective-C Bonjour/TCP stack out there,
I was wondering if anyone knows of any good open source app templates out
I was wondering if anyone knows how could I make my own "Webpage screenshot
Just wondering if anyone knows of an example out there, or class I can

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.