title: CAGradientLayer properties not animating within UIView animation block
body: <p>I have a feeling I'm overlooking something elementary, but what better way to find it than to be wrong on the internet?</p>
  
  <p>I have a fairly basic UI. The view for my <code>UIViewController</code> is a subclass whose <code>+layerClass</code> is <code>CAGradientLayer</code>. Depending on the user's actions, I need to move some UI elements around, and change the values of the background's gradient. The code looks something like this:</p>
  
  <pre><code>[UIView animateWithDuration:0.3 animations:^{
    self.subview1.frame = CGRectMake(...);
    self.subview2.frame = CGRectMake(...);
    self.subview2.alpha = 0;
  
    NSArray* newColors = [NSArray arrayWithObjects:
                           (id)firstColor.CGColor,
                           (id)secondColor.CGColor,
                           nil];
    [(CAGradientLayer *)self.layer setColors:newColors];
  }];
  </code></pre>
  
  <p>The issue is that the changes I make in this block to the subviews animate just fine (stuff moves and fades), but the change to the gradient's colors does not. It just swaps.</p>
  
  <p>Now, <a href="https://developer.apple.com/library/ios/documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/AnimatingViews/AnimatingViews.html#//apple_ref/doc/uid/TP40009503-CH6-SW12" rel="noreferrer">the documentation does say</a> that Core Animation code within an animation block won't inherit the block's properties (duration, easing, etc.). But is it the case that that doesn't define an animation transaction at all? (The implication of the docs seems to be that you'll get a default animation, where I get none.)</p>
  
  <p>Do I <em>have</em> to use explicit <code>CAAnimation</code> to make this work? (And if so, why?)</p>