IOS: rotation uiimageview

In my application, I have an image, its name is an arrow, and I rotate it 180 degrees as follows:

arrow.transform = CGAffineTransformMakeRotation(M_PI);

it works fine, but now I want this image to return to its original position; What taht value should I set to receive it?

+5
source share
3 answers

To return it to its original position, simply do the following:

arrow.transform = CGAffineTransformMakeRotation(0);

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

+11
source

Try returning the property transformto the identity matrix. those.CGAffineTransformIdentity

+10
source

Swift3:

arrow.transform = CGAffineTransform(rotationAngle: rotation);

where rotation is the angle of rotation in radians.

0
source

All Articles