title: CAShapeLayer cropping image
body: <p>I am trying to crop an image using CAShapeLayer with this code</p>
  
  <pre><code>    CALayer* contentLayer = [CALayer layer];
      CAShapeLayer* mask = [CAShapeLayer layer];
  
      CGMutablePathRef path = CGPathCreateMutable();
  
      CGPathMoveToPoint(path, NULL, 10, 10);
      CGPathAddLineToPoint(path, NULL, 10, 80);
      CGPathAddLineToPoint(path, NULL, 80, 80);
      CGPathAddLineToPoint(path, NULL, 80, 10);
      mask.path = path;
  
      [contentLayer setContents:(id)[[UIImage imageNamed:@"image.png"] CGImage]];
      [contentLayer setMask:mask];          
  
      [[self layer]addSublayer:contentLayer];
  </code></pre>
  
  <p>After executing this I can see just empty view; </p>