views:

41

answers:

1

The Apple documentation claims that the Core Animation action key kCAOnOrderOut has one sole purpose: to animate a layer out of sight when it either becomes hidden or has -removeFromSuperlayer called on it. I'm only referring to the latter case in this question.

In practice, when -removeFromSuperlayer is called, the layer is removed immediately, and no animation is performed on it.

It's been hinted at that this is a difference between the Presentation and Model layers, but I'm not experienced enough in Core Animation to know what to make of this.

If anyone can explain how to force the animation to run before the layer is removed, when the animation is returned for the key kCAOnOrderOut, it would be appreciated by at least me and a few other people.

Thanks.

A: 

I have no idea how to implement it with the key kCAOnOrderOut, but I ran into a similar problem a while back. My fix was to set the animation with a specific duration and immediately send off a delayed timer that waited the same amount of time as the animation duration. After my timer fired I would remove the layer/view.

Pyro2927
This is the standard hack I and everyone else use for the time being, yes; but it should be completely unnecessary to "hack" this; kCAOnOrderOut should simply work as documented.
Steven Degutis