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?
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.
Try returning the property transformto the identity matrix. those.CGAffineTransformIdentity
transform
CGAffineTransformIdentity
Swift3:
arrow.transform = CGAffineTransform(rotationAngle: rotation);
where rotation is the angle of rotation in radians.