or azran or azran - 4 months ago 18
iOS Question

Spin UIImageView continuously

I am having a problem while trying to rotate

UIImageview
continuously with a ball's image inside. I would like this ball to spin continuously on its center axis.
I have tried using
CGAffineTransform
but it didn't work.

Please help!

Answer

It should work if you use transforms as:

itemToRotate.transform = CGAffineTransformRotate(itemToRotate.transform, currentAngle);

I've uploaded some sample code of a working solution. Add your logic to rotate it automatically...