I'm reasonably new to iOS/Obj-C/Cocoa development (day 5!), so I'm sure I'm probably missing something basic here, but anyway…
Say I have an animation (a CABasicAnimation) to change the position.y property of my CALayer. I set the duration to 10 seconds, and start the animation. 5 seconds later, due to user interaction, I want to change the destination position.y of the animation.
I have tried two approaches:
Change the
toValueof the in-flight animationThis simply resulted in no change to the animation (though obviously it "jumped" to the actual position when it was over)
Cancel the running animation (
removeAnimationForKey:), and start a new one. The issue here is I have no way to get the currentposition.yfrom the running animation for the new animation.
I see (brief/vague) mention of "animation retargeting" in the Core Animation documentation for OS X, but no such mention in iOS.
Is this possible?
fromValue = [[layer presentationLayer] position].y;- Felix