IOS: rotate an uiimageview

13,914

Solution 1

To make it return to it's original position, just do this:

arrow.transform = CGAffineTransformMakeRotation(0);

In degrees, 0 radians is 0 degrees, so it should return to its original position.

Solution 2

Try setting the transform property back to the identity matrix. i.e. CGAffineTransformIdentity

Share:
13,914
cyclingIsBetter
Author by

cyclingIsBetter

Updated on July 27, 2022

Comments

  • cyclingIsBetter
    cyclingIsBetter almost 2 years

    in my app I have an imageview, its name is arrow and I rotate it of 180 degrees in this way:

    arrow.transform = CGAffineTransformMakeRotation(M_PI);
    

    it work fine, but now I want that this imageview return in the original position; what's the value taht I should set to obtain it?