title: Why when I set a low duration value for my CABasicAnimation does it jump?
body: <p><strong>Sample Project:</strong> <a href="http://cl.ly/1W3V3b0D2001" rel="noreferrer">http://cl.ly/1W3V3b0D2001</a></p>
  
  <p>I'm using <code>CABasicAnimation</code> to create a progress indicator that is like a pie chart. Similar to the iOS 7 app download animation:</p>
  
  <p><img src="https://i.stack.imgur.com/HBrb3.png" alt="enter image description here"></p>
  
  <p>The animation is set up as follows:</p>
  
  <pre><code>- (void)drawRect:(CGRect)rect
  {
      [super drawRect:rect];
  
      CGFloat radius = CGRectGetWidth(self.frame) / 2;
      CGFloat inset  = 1;
      CAShapeLayer *ring = [CAShapeLayer layer];
      ring.path = [UIBezierPath bezierPathWithRoundedRect:CGRectInset(self.bounds, inset, inset)
                                             cornerRadius:radius-inset].CGPath;
  
      ring.fillColor = [UIColor clearColor].CGColor;
      ring.strokeColor = [UIColor whiteColor].CGColor;
      ring.lineWidth = 2;
  
      self.innerPie = [CAShapeLayer layer];
      inset = radius/2;
      self.innerPie.path = [UIBezierPath bezierPathWithRoundedRect:CGRectInset(self.bounds, inset, inset)
                                                 cornerRadius:radius-inset].CGPath;
      self.innerPie.fillColor = [UIColor clearColor].CGColor;
      self.innerPie.strokeColor = [UIColor whiteColor].CGColor;
      self.innerPie.lineWidth = (radius-inset)*2;
  
      self.innerPie.strokeStart = 0;
      self.innerPie.strokeEnd = 0;
  
      [self.layer addSublayer:ring];
      [self.layer addSublayer:self.innerPie];
  
      self.progress = 0.0;
  }
  </code></pre>
  
  <p>The animation is triggered by setting the progress of the view:</p>
  
  <pre><code>- (void)setProgress:(CGFloat)progress animated:(BOOL)animated {
      self.progress = progress;
  
      if (animated) {
          CGFloat totalDurationForFullCircleAnimation = 0.25;
  
          CABasicAnimation *pathAnimation = [CABasicAnimation animationWithKeyPath:@"strokeEnd"];
          self.innerPie.strokeEnd = progress;
          pathAnimation.delegate = self;
          pathAnimation.fromValue = @([self.innerPie.presentationLayer strokeEnd]);
          pathAnimation.toValue = @(progress);
          pathAnimation.duration = totalDurationForFullCircleAnimation * ([pathAnimation.toValue floatValue] - [pathAnimation.fromValue floatValue]);
  
          [self.innerPie addAnimation:pathAnimation forKey:@"strokeEndAnimation"];
      }
      else {
          [CATransaction setDisableActions:YES];
          [CATransaction begin];
          self.innerPie.strokeEnd = progress;
          [CATransaction commit];
      }
  }
  </code></pre>
  
  <p>However, in cases where I set the progress to something small, such as <code>0.25</code>, there's a jump in the animation. It goes a little forward clockwise, jumps back, then keeps going forward as normal. It's worth nothing that <em>this does not happen if the duration or progress is set higher</em>.</p>
  
  <p>How do I stop the jump? This code works well in every case except when the progress is very low. What am I doing wrong?</p>