title: How can I erase a line between two CGpoint?
body: <p><img src="https://i.stack.imgur.com/ByGi3.png" alt="enter image description here" /></p>
  <p>I am creating a line in ipad as user touch the screen and and drag the finger. Problem is line is creating on every point in by (touchMoved:) we we drag it. But in last it should only one not many. How can I erase or remove last line after created new one? Here is my code:</p>
  <pre><code>- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
      if(ArrowDraw==YES){
          NSLog(@&quot;ArrowDrawing&quot;);
          if ([[event allTouches]count]==1){
              UITouch *touch = [touches anyObject];
              CGPoint currentPoint = [touch locationInView:FullImageView];
              UIGraphicsBeginImageContext(self.view.frame.size);
              [self.tempDrawImage.image drawInRect:CGRectMake(0, 0,      self.view.frame.size.width, self.view.frame.size.height)];
              CGContextMoveToPoint(UIGraphicsGetCurrentContext(), firstPoint.x, firstPoint.y);
              CGContextAddLineToPoint(UIGraphicsGetCurrentContext(), currentPoint.x, currentPoint.y);
              CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);
              CGContextSetLineWidth(UIGraphicsGetCurrentContext(), 1 );
              CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), red, green, blue, 1.0);
              CGContextSetBlendMode(UIGraphicsGetCurrentContext(),kCGBlendModeNormal);
              CGContextStrokePath(UIGraphicsGetCurrentContext());
              self.tempDrawImage.image = UIGraphicsGetImageFromCurrentImageContext();
              [self.tempDrawImage setAlpha:opacity];
              UIGraphicsEndImageContext();
              //firstPoint = currentPoint;
              NSLog(@&quot;TouchMoving x=%f y=%f&quot;,firstPoint.x,firstPoint.y);
          }
          UIGraphicsBeginImageContext(self.FullImageView.frame.size);
          [self.FullImageView.image drawInRect:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) blendMode:kCGBlendModeNormal alpha:1.0];
          [self.tempDrawImage.image drawInRect:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) blendMode:kCGBlendModeNormal alpha:opacity];
          self.FullImageView.image = UIGraphicsGetImageFromCurrentImageContext();
          UIGraphicsEndImageContext();
          self.tempDrawImage.hidden=YES;
      }
  }
  </code></pre>