I'm not sure exactly what you are wanting, but if you need to get the current value of an animated property while 'in-flight', you can get the layer's presentationLayer field and check the field there instead.

Also, you should keep in mind that using the fillMode and setting the animation to persist (setRemovedOnCompletion:YES) does not actually change the value of the animated property. This merely cause a visual 'sticky' effect. You have to actually change the property value explicitly by calling set (e.g. setBounds, setPosition, etc.). This of course will trigger an implicit animation, so the trick is to set the value and then override the animation in the current run loop so that the value will get set while also animating it the way you want to animate it explicitly. There are other ways to do it, but I think that's the simplest.

I'm realizing that may have just muddied the waters a bit, but let me know if you need me to clarify.

-Matt

p.s. Here's another blog post that demonstrates how to take advantage of the layer's presentationLayer: http://www.cimgf.com/2008/11/05/core-animation-tutorial-interrupting-animation-progress/



On Nov 12, 2008, at 8:23 AM, Fabrizio Guglielmino wrote:

Many thanks....I've tried and it works but I still have a problem.
If I made a second animation (rotation) of the image, after it's
previous rotated, it seems to make this second animation using as
starting point the original position of the image and not the rotated
image, in this sense I was talking about persistence of rotation.
To better explain: I make 90 degrees rotation clockwise, after I make
10 degrees anticlockwise it start from original point (vertical image)
and not from 90 degree rotated image.

Meanwhile I've placed  an order on Amazon for ""Core Animation for Mac
OS X and the iPhone: Creating Compelling Dynamic User Interfaces"  ;-)

Many thanks

2008/11/12 Matt Long <[EMAIL PROTECTED]>:
You need both of these lines when you create your animation:
[animation setRemovedOnCompletion:NO];
[animation setFillMode:kCAFillModeForwards];
Here is a related blog
post: 
http://www.cimgf.com/2008/10/25/core-animation-tutorial-slider-based-layer-rotation/
-Matt

On Nov 12, 2008, at 7:57 AM, Fabrizio Guglielmino wrote:

Hi all,
in a simple project I need to rotate about the Z vector a little image.
I've used CAKeyframeAnimation with CATransform3DMakeRotation and it
was really simple.

My problem is about persistence of rotation, when animation end the
image return in original position and this isn't what
I want. I can't understand if this is the normal behaviour of
CATransorm3DMakeRotation or I'm making something wrong, I've also
see a property called removedOnCompletion but it don't seem change anything.
Many thanks
Fabrizio
_______________________________________________



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to