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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:42:05+00:00 2026-05-12T18:42:05+00:00

I need to rotate in image multiple times in 90 degrees I am using

  • 0

I need to rotate in image multiple times in 90 degrees I am using following code,

CGAffineTransform transform = CGAffineTransformMakeRotation(PI/2);
shape.transform = transform;

here shape being my UIImageview.

The problem is every time i click on rotate button it rotates it from its original position, which is not what I want. I would it to rotate from the new position.

I am new to iphone programming, apologies if I am missing on something very basic and thanks in advance for you help.

Kedar

  • 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-12T18:42:05+00:00Added an answer on May 12, 2026 at 6:42 pm

    If you are trying to animate this rotation, you might want to read my answer to this question, where someone was attempting to animate an incremental rotation of a view. It turns out that incremental animation of a transform using CABasicAnimations is a little trickier than you would expect. You first need to read the current transform of your UIView’s layer from its presentationLayer, then feed that into your animation as the fromValue.

    However, in your case it appears that you are using a UIView animation block to animate the transform property of your view. The code as you have written it would only keep setting your view’s transform to the same 90 degree rotation, it wouldn’t incrementally rotate the view by 90 degree steps. To do an incremental rotation, I believe you’d need something like the following:

    CGAffineTransform transform = CGAffineTransformRotate(shape.transform, M_PI / 2.0f);
    shape.transform = transform;
    

    which will grab the current transform of the view, rotate it by 90 degrees, and then apply the resulting transform to the view. Again, this may run into the same issues as with the CABasicAnimations, in which case you should consult the above-linked answer.

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

Sidebar

Related Questions

I need to rotate an image when the user do a two finger twist
I need to write a program that uses matrix multiplication to rotate an image
I need to know how to rotate an image, which is in yuv420p format
I need a java method to rotate an image like this , I would
I need to rotate an ImageView by a few degrees. I'm doing this by
I am working on one component where I need to scale and rotate image.
After I load an image from the device, I need to rotate it 37.8
I need to recreate the following design using only CSS : What you're seeing
I have an application where I need to slide and rotate an image at
I need to be able to rotate an image around a given point so

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.