0

I have the following code:

CAShapeLayer* lay = [CAShapeLayer layer];
lay.path = [UIBezierPath bezierPathWithArcCenter:CGPointMake(150, 150) radius:40 startAngle:0 endAngle:360 clockwise:YES].CGPath;

lay.fillRule = kCAFillRuleEvenOdd;
self.contentView.layer.mask = lay;

At

At left is what I want, at right is what I get.

I want to cut a circular hole from the contentView, this code masks it to the specified path but this is not I want. Thanks in advance.

MahmutTariq
  • 217
  • 1
  • 4
  • 17
  • @the4kman the approach is different, he adds two layers above each other with opacity to the upper one, I want to cut a path from the view to display whatever behind it. – MahmutTariq Sep 19 '17 at 08:13
  • There are different approaches under the question, which is essentially the same problem you are facing. – Tamás Sengel Sep 19 '17 at 08:14

0 Answers0