Search code examples
core-animation

During an animation, can the properties of every CALayer be read atomically in the presentationLayer tree?


I'm looking for a solution to make a video from a CoreAnimation animation.

If I recursively enumerate the sublayers of my root CALayer presentation layer, is there a risk that the values(position, transform, opacity..) keep on changing while I'm a reading the properties in the (presentation) tree ? Or is the presentation layer like a deep copy of the CALayer hierarchy ?


Solution

  • The presentation layer is a deep copy of the model layer, with all the active animations applied. It's not actually the literal presentation tree that's used to render to screen, it's just an approximation.