views:

1987

answers:

2

What do I have to do, if I need to rotate an UIImageView? I have an image which I want to rotate by 20 degrees.

The Apple Docs talk about an transformation Matrix, but that sounds incredible difficult. Are there any helpful methods or functions to achieve that?

A: 

As far as I know, using the matrix in UIAffineTransform is the only way to achieve a rotation without the help of a third-party framework.

Marc W
+12  A: 

A transformation matrix is not incredibly difficult. It's quite simple, if you use the supplied functions:

imgView.transform = CGAffineTransformMakeRotation(.34906585);

(.34906585 is 20 degrees in radians)

Ed Marty
Thanks! And I really thought it's complicated, just because of the "transform matrix" ;)
Thanks