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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:04:01+00:00 2026-05-30T21:04:01+00:00

I have seen some app, they are able to scale and rotate the image

  • 0

I have seen some app, they are able to scale and rotate the image at the same time. It does not require to release the finger touch.

My following code require to:
1. Touch to scale
2. Release
3. Touch to rotate

How do i scale and rotate at the same time?

In my main code:

UIPanGestureRecognizer *imagePanGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(moveImage:)];
[imagePanGesture setMinimumNumberOfTouches:1];
[imagePanGesture setMaximumNumberOfTouches:1];
[tempImageView addGestureRecognizer:imagePanGesture]; 

UIPinchGestureRecognizer *pinchGesture = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(scaleImage:)];
[tempImageView addGestureRecognizer:pinchGesture];  

UIRotationGestureRecognizer *rotationGesture = [[UIRotationGestureRecognizer alloc] initWithTarget:self action:@selector(rotateImage:)];
[tempImageView addGestureRecognizer:rotationGesture]; 

In individual scale and rotate

- (void)scaleImage:(UIPinchGestureRecognizer *)recognizer 
{
    if([recognizer state] == UIGestureRecognizerStateEnded) 
    {
        previousScale = 1.0;
        return;
    }

    CGFloat newScale = 1.0 - (previousScale - [recognizer scale]);

    CGAffineTransform currentTransformation = [recognizer view].transform;
    CGAffineTransform newTransform = CGAffineTransformScale(currentTransformation, newScale, newScale);

    [[recognizer view] setTransform:newTransform];
    previousScale = [recognizer scale];
}

- (void)rotateImage:(UIRotationGestureRecognizer *)recognizer 
{
    if([recognizer state] == UIGestureRecognizerStateEnded) {


            previousRotation = 0.0;
            return;
        }

        CGFloat newRotation = 0.0 - (previousRotation - [recognizer rotation]);

        CGAffineTransform currentTransformation = [recognizer view].transform;
        CGAffineTransform newTransform = CGAffineTransformRotate(currentTransformation, newRotation);

        [[recognizer view] setTransform:newTransform];

        previousRotation = [recognizer rotation];
    }
  • 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-30T21:04:02+00:00Added an answer on May 30, 2026 at 9:04 pm

    You may check this http://www.raywenderlich.com/6567/uigesturerecognizer-tutorial-in-ios-5-pinches-pans-and-more

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

Sidebar

Related Questions

I have seen some apps with a button to rate the app. It brigs
i have seen some hand rolled solutions but does jquery out of the box
My facebook app sends out requests to some users who have not yet added
I have seen some tutorials on the subject, but they all go half into
Has anyone seen iPad greeting cards app... what they have done is released the
Have seen some similar questions: What is the difference between a JavaBean and a
I have seen some people in SO commenting that Singleton Pattern is an anti-pattern.
I have seen some related questions but none focusing on the specific problem I
I have seen some mails which has HTML content embedded in them. The content
I have seen some instances where people will say you have to use JS

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.