title: CABasicAnimation in a CAGradientLayer not working - what am I doing wrong?
body: <p>I have a custom UITableView cell which has a button and a label. I fire a method when someone taps on the button, and then color that row. It's all working fine.</p>
  
  <p>What I want to actually do is</p>
  
  <ol>
  <li>user taps button, the row is colored in a gradient (it works now)</li>
  <li>The gradient fades away</li>
  </ol>
  
  <p>My code is below (BackView is the view in my custom cell)</p>
  
  <pre><code>CAGradientLayer *layer = [CAGradientLayer layer];
  layer.frame = BackView.bounds;
  
  UIColor *cOne     = [UIColor paleYellowColor];
  UIColor *cTwo     = [UIColor whiteColor];
  
  NSArray *colors =  [NSArray arrayWithObjects:(id)cOne.CGColor,
                      cTwo.CGColor, nil];
  
  layer.colors = colors;
  
  NSNumber *stopOne     = [NSNumber numberWithFloat:0.00];
  NSNumber *stopTwo     = [NSNumber numberWithFloat:0.8];
  
  NSArray *locations = [NSArray arrayWithObjects:stopOne, stopTwo, nil];
  layer.locations = locations;
  
  CABasicAnimation *animateLayer = [CABasicAnimation animationWithKeyPath:@"colors"];
  animateLayer.fromValue = [UIColor paleYellowColor];
  animateLayer.toValue = [UIColor whiteColor];
  animateLayer.duration   = 3.0;
  animateLayer.removedOnCompletion = YES;
  animateLayer.fillMode = kCAFillModeBoth;
  animateLayer.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
  [layer addAnimation:animateLayer forKey:@"animation"];
  
  [BackView.layer insertSublayer:layer atIndex:0];
  </code></pre>
  
  <p>With this code, when I touch the button on the row, the background gets a gradient, but it never fades away, there's no animation - nothing. What am I doing wrong? I tried a few permutations and saw some examples, but none that helped me get this working.</p>
  
  <p>Thanks!</p>