Search code examples
iphonecore-animation

Will sending -removeAllAnimations to a layer also propagate to all it's sublayers?


I wonder if sublayer animations would continue to play if I send -removeAllAnimations to a parent layer.


Solution

  • As per the documentation for removeAllAnimations:

    Remove all animations attached to the receiver.

    You'll need to iterate through the sublayers and remove animations from them as well:

    for (CALayer* layer in [containerLayer sublayers]) {
      [layer removeAllAnimations];
    }