Snowing effect with CAReplicatorLayer

1.2k Views Asked by At

I have a single snowflake image that I would like to replicate and create snowfall on the screen. We can set the instanceCount to X to create a large number of snowflakes and we can set the instanceTransform to put each instance some distance from the next.

However I am not clear how to make them fall down. Does anyone understands if this class was intended to be used for something like this and if so how should it be properly done?

1

There are 1 best solutions below

3
adam On

You apply the animation to the original sublayer.... all the replicated layers follow the same animation, adjusted by the instanceDelay and instanceTransform properties.

Hope this helps!