title: CALayer create transparent round mask
body: <p>I want to create a mask layer which is a circle that makes the circle content transparent and keep everything around. Unfortunately, the following code does the opposite, it draws a circle and make everything around transparent.</p>
  
  <pre><code>CAShapeLayer * shape = [CAShapeLayer layer];
  shape.frame          = CGRectMake((CGSSize().width/2.f)-40.f, -40.f, 80.f, 80.f);
  
  CGPathRef pathRef    =
  CGPathCreateWithEllipseInRect(CGRectMakeBoundsWithSize(shape.frame.size), NULL);
  
  shape.path            = pathRef;
  shape.fillColor       = [UIColor blueColor].CGColor;
  
  self.layer.mask = shape;
  </code></pre>