views:

110

answers:

1

I wish to do some custom animation using core animation but am having the (no doubt) classic problem of animations resetting when they have completed.

Of course this can be stopped by using:

[animation setFillMode:kCAFillModeForwards];
[animation setRemovedOnCompletion: YES];

However, I am then left with a layer that won't respond to requests to move it as an animation remains in place.

I could remove the animation, but then the position is lost... plus it all seems too complicated for something that should be achievable simply...

What I would like is that when the animation is complete, the animation leaves the layer where it left it, and then disappears as if it was never even there.

The same behaviour as an implicit animation. How can this be achieved?

At the moment I'm having to set the animation delegate and listen out for animationDidStop:finished: calls, where I then have to disable implicit animations, set the value/s from the presentation layer, and commit the "animation".

There has to be an easier way...

+1  A: 

You might want to have a look at http://stackoverflow.com/questions/3086516/uiview-displays-improperly-after-its-layer-has-been-animated, your problem seems very similar.

KPM