title: Reposition/resize UIBezierPath
body: <p>I have a draggable view that has a mask layer on it. The mask layer has a UIBezierPath on it which makes an area on the view see-through/transparent(the effect that i want). My end goal is to change the position and size of the path(not the mask layer!) by passing a CGRect that is calculated based on the intersection of my view and another rectangle(Basically I want to hide the area that intersects).</p>
  
  <p>1)How I create my mask and path(creates a see-through rectangle on my view):</p>
  
  <pre><code>self.maskLayer = [CAShapeLayer layer];
  self.maskLayer.frame = self.contentView.bounds;
  
  //default path rect
  CGRect const rect = CGRectMake(CGRectGetMidX(self.contentView.bounds) ,
                                       CGRectGetMidY(self.contentView.bounds),
                                       50,50);
  
  
  path = [UIBezierPath bezierPathWithRect:rect];
  
  [path appendPath:[UIBezierPath bezierPathWithRect:self.contentView.frame]];
  
  self.maskLayer.path = path.CGPath;
  
  self.maskLayer.fillRule = kCAFillRuleEvenOdd;
  
  self.contentView.layer.mask = self.maskLayer;
  </code></pre>
  
  <p>2) My problem is that I couldn't find a way to resize/reposition just the path. I searched online but couldn't find any solution.</p>
  
  <p>This code is not working but is what I could think of:</p>
  
  <pre><code>//runs while the view is being dragged(using UIPanGestureRecognizer)
  -(void)move{
   CGRect intersectedRect = CGRectIntersection(self.frame, self.productView.frame);
   path = [UIBezierPath bezierPathWithRect:intersectedRect];
  [path appendPath:[UIBezierPath bezierPathWithRect:intersectedRect]];
  [self.maskLayer setNeedsDisplay];
   }
  </code></pre>
  
  <p>How can I manipulate just the path of the masklayer in my move function?
  Thank you!</p>