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

后端 未结 1 474
醉梦人生
醉梦人生 2020-12-17 23:46

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

1条回答
  •  南笙
    南笙 (楼主)
    2020-12-18 00:21

    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];
    }
    

    0 讨论(0)
提交回复
热议问题