I\'m trying to animate a rotation of 180 degrees of a UIImageView in Swift
UIImageView
UIView.animateWithDuration(1.0, animations: { () -> Void in
For me the best and shortest solution is (Swift 3/4):
self.YourImageView.transform = showing ? CGAffineTransform(rotationAngle: CGFloat.pi) : CGAffineTransform.identity
"showing" it's a value to determine is image rotated before or not - you can use your own logic here