title: How to save a masked image in iOS
body: <p>This is what I am doing to mask an image.. This is working fine.. My problem is that self.imgView.image is not the masked image.. How can I retrieve masked images? Thanks.</p>
  
  <pre><code>- (void) setClippingPath:(UIBezierPath *)clippingPath : (UIImageView *)imgView {
  
      CAShapeLayer *maskLayer = [CAShapeLayer layer];
      maskLayer.frame = self.imgView.frame;
      maskLayer.path = [clippingPath CGPath];
      maskLayer.fillColor = [[UIColor whiteColor] CGColor];
      maskLayer.backgroundColor = [[UIColor clearColor] CGColor];
  
      self.imgView.layer.mask = maskLayer;
  
  }
  </code></pre>