-1

I got a CALayer and I want to copy it into 5 or more CALayers in ViewdidLoad is there is a possible way to do this. Here is my layer:

alye = [CALayer layer];
alye.position = CGPointMake(129, 189);
alye.bounds = CGRectMake(0, 0, theHeight/13.45, theWidth/2.66);
alye.backgroundColor = [UIColor redColor].CGColor;
alye.opacity = 0.6f;
[self.view.layer addSubLayer:alye];

Any help please?
Thanks in advance

AFB
  • 550
  • 2
  • 8
  • 25

1 Answers1

4

If you want to create multiple duplicates of a layer, take a look at a CAReplicatorLayer. That lets you create multiple copies of a source layer, applying a transform to each copy.

Duncan C
  • 128,072
  • 22
  • 173
  • 272