Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Flip UIImageView 180 degree (not animated)

How can I flip a UIImageView 180 degrees, but NOT animating the flip. I just want when it loads, to show it 180 degrees of the original image.

like image 937
Nic Hubbard Avatar asked Dec 14 '11 04:12

Nic Hubbard


2 Answers

Swift 5.2

imageView.transform = CGAffineTransform(rotationAngle: CGFloat.pi)
like image 130
rbaldwin Avatar answered Oct 15 '22 13:10

rbaldwin


In viewDidLoad or in the method where you are loading the image, do the following:

imageView.transform = CGAffineTransformMakeRotation(M_PI);

Hope this helps.

like image 41
Ilanchezhian Avatar answered Oct 15 '22 14:10

Ilanchezhian