title: Drawing a line with Bezierpath using CAShapeLayer object
body: <p>I am making an image editor which can create different shapes objects like circle, triangle and square which can also be updated or removed. So I have used <code>CAShapeLayer</code> for creating shapes objects. </p>
  
  <p>Now I also want to draw a line on image which can also be updated or removed so I have used bezierpath and <code>CAShapeLayer</code> to create the line, it is working fine. BUT now the problem is that when I want to select any existing line it can be selected any where close to line tool because <code>CAShapeLayer</code> also set the fill region which will be a straight line from start point to end point. </p>
  
  <p>My question is that how can I create line with no fill region using <code>CAShapeLayer</code>.</p>
  
  <p>Here is my code for creating line:</p>
  
  <pre><code>CAShapeLayer *line = [CAShapeLayer layer];
  // Using bezierpath to make line 
  UIBezierPath *linePath=[UIBezierPath bezierPath];
  
  // Creating L with line
  
  [linePath moveToPoint:point1];
  [linePath addToPoint:point2];
  [linePath addToPoint:point3];
  line.path=linePath.CGPath;
  
  
  // Configure the appearence of the line
  line.fillColor = Nil;
  line.opacity = 1.0;
  line.strokeColor = [UIColor whiteColor].CGColor;
  </code></pre>
  
  <p>Any idea on this will be really appreciated.</p>