title: CABasicAnimation + UIBezierPath
body: <p>I'm trying to create a circular bar such the one that you can find around the recording button in the native camera on iOS when you are doing a timelapse.</p>
  
  <p>A circle is created along the animation, and once it is completed is removed again "naturally".</p>
  
  <p>I tried next code:</p>
  
  <pre><code>CAShapeLayer *circle = [CAShapeLayer layer];
  circle.path = [UIBezierPath bezierPathWithArcCenter:CGPointMake(self.lapseBtnOutlet.center.x, self.lapseBtnOutlet.center.y) radius:28 startAngle:2*M_PI*0-M_PI_2 endAngle:2*M_PI*1-M_PI_2 clockwise:YES].CGPath;
  circle.fillColor = [UIColor clearColor].CGColor;
  circle.strokeColor = [UIColor whiteColor].CGColor;
  circle.lineWidth = 2.0;
  
  CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"strokeEnd"];
  animation.duration = self.lapseInterval;
  animation.removedOnCompletion = NO;
  animation.fromValue = @(0);
  animation.toValue = @(1);
  animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
  [circle addAnimation:animation forKey:@"drawCircleAnimation"];
  </code></pre>
  
  <p>But my problem now is that I don't know how to "remove" the line from start-to-end.</p>
  
  <p>I tried with autoreverse property, but it removes the circle from end-to-start instead from start-to-end. Any ideas? </p>