What I find interesting with CAReplicatorLayer:
I would like to get hands on either the source code or get some knowledge of the magic behind CAReplicatorLayer. I would like to have a CALayer class similar to CAReplicatorLayer, but with more control. I would like to have control on the transform individually for each replicated instance.
So asked in a totally different manner: is it possible to get the "backing store" for a CALayer and display it however I want as many times I want?
(by "backing store" I mean the rendered texture for the CALayer/UIView. I don't know much about what's happening under the hoods of CoreAnimation/QuartzCore).
Why I'm not looking at alternatives like e.g. rendering the CALayer to a UIImage:
You can create a new CALayer very easily with the following line of code: CALayer *sublayer = [CALayer layer]; Once you have a CALayer, you can set any properties on it you'd like. But remember there's one property you definitely have to set: it's frame (or bounds/position).
An object that manages image-based content and allows you to perform animations on that content.
All UIView subclasses have a layer property, which is responsible for drawing their contents efficiently. These layers are powered by Core Animation, which handles all the drawing and animation that UIKit requests.
A layer is a simple model class that exposes a number of properties to represents some image-based content. Every UIView is backed by a layer, so you can think of layers as the lower-level behind the scenes class behind your content.
The special-purpose CALayers like CAReplicatorLayer or CAGradientLayer are able (via private APIs) do execute their drawing directly on the GPU using fast filling or copying. In a sense they are different such that the backing store is not in normal RAM, but directly on the GPU.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With