title: View Layer insertSublayer is not updating the layer
body: <p>I am trying to add a gradient layer to my view, first time when I run the code it inserts the layer perfectly but every 10 sec I run the same function again to change the layer but it doesn't update the layer. </p>
  
  <pre><code>if ([[self.view.layer sublayers] count]&gt;1) {
      CAGradientLayer *gradientLayer=[ColorUtilities randomGradient];
      gradientLayer.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
      [self.view.layer insertSublayer:gradientLayer atIndex:0];
      //[self.view.layer replaceSublayer:[[self.view.layer sublayers] objectAtIndex:0] with:gradientLayer];
  }
  </code></pre>
  
  <p>here <code>[ColorUtilities randomGradient]</code> gives me a random layer every time. </p>
  
  <p>why layer <code>atindex:0</code> is not updated? </p>