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); >
arrow.transform = CGAffineTransformMakeRotation(M_PI);
Swift3:
arrow.transform = CGAffineTransform(rotationAngle: rotation);
where rotation is the angle to rotate in radians.