2

This is what I used:

UIBezierPath *_path;
shapeLayer.path = _path.CGPath;
shapeLayer.lineWidth =10;
shapeLayer.lineCap=kCALineCapRound;
UIColor *color=[dict objectForKey:@"Colors"];
shapeLayer.strokeColor = color.CGColor;
shapeLayer.fillColor = [UIColor clearColor].CGColor;
[self.layer addSublayer:shapeLayer];

I am not able to delete the layer from in-between.

Pang
  • 9,564
  • 146
  • 81
  • 122

1 Answers1

0
[self.view.layer addSublayer:REFERENCE_LAYER];

Keep a reference of the layer that you want to add. Then, you can easily remove the layer:

[REFERENCE_LAYER removeFromSuperlayer];
Pang
  • 9,564
  • 146
  • 81
  • 122
Anoop
  • 409
  • 3
  • 13