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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T23:35:14+00:00 2026-05-28T23:35:14+00:00

I have a view which the user can pinch to grow or shrink. I’d

  • 0

I have a view which the user can pinch to grow or shrink. I’d like this to work along two axes – if the pinch is mostly horizontal, it will grow/shrink the object horizontally, but if the pinch is mostly vertical, it will grow/shrink the object vertically.

Can I achieve this with one or two pinch recognizers, and if so, how?

  • 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-28T23:35:15+00:00Added an answer on May 28, 2026 at 11:35 pm

    You might be able to use a UIPinchGestureRecognizer for this, but you will have to write code to figure out if the pinch is horizontal or vertical. I haven’t tested this:

    typedef enum {
        PinchAxisNone,
        PinchAxisHorizontal,
        PinchAxisVertical
    } PinchAxis;
    
    PinchAxis pinchGestureRecognizerAxis(UIPinchGestureRecognizer *r) {
        UIView *view = r.view;
        CGPoint touch0 = [r locationOfTouch:0 inView:view];
        CGPoint touch1 = [r locationOfTouch:1 inView:view];
        CGFloat tangent = fabsf((touch1.y - touch0.y) / (touch1.x - touch0.x));
        return
            tangent <= 0.2679491924f ? PinchAxisHorizontal // 15 degrees
            : tangent >= 3.7320508076f ? PinchAxisVertical   // 75 degrees
            : PinchAxisNone;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following View of my CanvasModel, on which the user can drag
I have a view in UIScrollView in which the user can zoom into. The
I have a view on which the user can draw some lines, which have
I have several uiimageviews on my view which the user can drag around. I
I have a View in which the user can choose any number of Clubs
I have a 'canvas' view in which the user can enter a short strings
I have a View in which the user is able to upload a file
I have created a View which prompts the user to input some records with
Please help me to turn off user interaction. I have a custom view which
I have a simple table view which is editable. All I need the user

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.