animate rotation

Posted by Mike on Stack Overflow See other posts from Stack Overflow or by Mike
Published on 2009-07-28T21:13:00Z Indexed on 2010/05/09 2:08 UTC
Read the original article Hit count: 299

Filed under:
|

I'm trying to animate a rotation using CATransform3DMakeRotation, but the problem is once the animation is finished, the image goes back to its initial position, i.e back to zero. But I'd like to keep it where it finished rotating. How would I do that?

edit What I'm trying to do is to create the same compass which comes with the new iPhone. Basically the locationmanager gives me new headings every few seconds (or several per second). Using the new heading and the timestamp, I was trying to get a smooth animation of the image but not getting anywhere. The only thing which seems to work is applying the transform directly, e.g.

compassimage.layer.transform = CATransform3DMakeRotation(newHeading.trueHeading *M_PI/180,0,0,1.0):

but that's not animated...

© Stack Overflow or respective owner

Related posts about rotation

Related posts about core-animation