title: Scroll UITableView with CABasicAnimation in uitableviewcell makes the animation jumpy
body: <p>I have a UITableView that inside its UITableViewCells I'm animating a chart pie layer with CABasicAnimation.</p>
  
  <p>The thing is that if I'm scrolling the table view while its animating the layer - the layer animation became jumpy and not "clean".</p>
  
  <p>Animation of the layer starts in:</p>
  
  <pre><code>tableView:willDisplayCell:forRowAtIndexPath:
  </code></pre>
  
  <p>Using dequeueReusableCellWithIdentifier as well:</p>
  
  <pre><code>static NSString *cellIdentifier = @"CellIdentifier";
  UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
  if(!cell)
  {
      cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
      ...
  }
  ...
  return cell;
  </code></pre>
  
  <p>Schedule timer to update progress of the chart:</p>
  
  <pre><code>- (void)startAnimation 
  {
  self.elapsedTimeTimer = nil;
  self.elapsedTimeTimer = [NSTimer scheduledTimerWithTimeInterval:0.02
                                                               target:self
                                                             selector:@selector(updateProgress)
                                                             userInfo:nil
                                                              repeats:YES];
  [[NSRunLoop currentRunLoop] addTimer:self.elapsedTimeTimer
                               forMode:NSRunLoopCommonModes];
  }
  
  - (void)updateProgress
  {
      if(!self.didEndProgress)
         self.progress += 0.01;
  
      if(self.progress &gt;= self.finalPercents/100)
      {
          [self.elapsedTimeTimer invalidate];
          self.elapsedTimeTimer = nil;
      }
  }
  </code></pre>
  
  <p>Layer implementation:</p>
  
  <pre><code>@implementation CircleGraphLayer
  @dynamic progress;
  
  + (BOOL)needsDisplayForKey:(NSString *)key {
  return [key isEqualToString:@"progress"] || [super needsDisplayForKey:key];
  }
  
  - (id&lt;CAAction&gt;)actionForKey:(NSString *)aKey {
  if ([aKey isEqualToString:@"progress"]) {
  
      CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:aKey];
      animation.fromValue = [self.presentationLayer valueForKey:aKey];
      return animation;
  }
  return [super actionForKey:aKey];
  }
  
  - (void)drawInContext:(CGContextRef)context {
  
  CGRect circleRect = CGRectInset(self.bounds, 1, 1);
  CGContextClearRect(context, circleRect);
  
  CGColorRef borderColor = [[UIColor colorWithWhite:1.0 alpha:0.4] CGColor];
  CGColorRef backgroundColor = [[UIColor clearColor] CGColor]; //[[UIColor colorWithWhite: 1.0 alpha: 0.15] CGColor];
  
  CGContextSetFillColorWithColor(context, backgroundColor);
  CGContextSetStrokeColorWithColor(context, [UIColor whiteColor].CGColor);
  CGContextSetLineWidth(context, 1.0f);
  
  CGContextFillEllipseInRect(context, circleRect);
  CGContextStrokeEllipseInRect(context, circleRect);
  
  CGFloat radius = MIN(CGRectGetMidX(circleRect), CGRectGetMidY(circleRect));
  CGPoint center = CGPointMake(radius, CGRectGetMidY(circleRect));
  CGFloat startAngle = -M_PI / 2;
  CGFloat endAngle = self.progress * 2 * M_PI + startAngle;
  CGContextSetFillColorWithColor(context, borderColor);
  CGContextMoveToPoint(context, center.x, center.y);
  CGContextAddArc(context, center.x, center.y, radius, startAngle, endAngle, 0);
  CGContextClosePath(context);
  CGContextFillPath(context);
  [super drawInContext:context];
  }
  @end
  </code></pre>
  
  <p>Any needful help will be appreciated.</p>