title: CAGradientLayer not working
body: <p>I created a new project. I linked <code>QuartzCore.framework</code> and imported <code>&lt;QuartzCore/QuartzCore.h&gt;</code> in the <code>ViewController.m</code>.</p>
  
  <p>And here is the code.</p>
  
  <pre><code>- (void)viewDidLoad {
      [super viewDidLoad];
  
      NSLog(@"view height %f", self.view.frame.size.height); // returns 667 on iPhone 6
      NSLog(@"view width %f", self.view.frame.size.width); // returns 375 on iPhone 6
  
      NSLog(@"layers count %lu", self.view.layer.sublayers.count); // returns 2
  
      // Gradient
      UIColor *colorOne = [UIColor blueColor];
      UIColor *colorTwo = [UIColor greenColor];
      NSArray *colorArray = @[colorOne, colorTwo];
  
      NSNumber *locationOne = [NSNumber numberWithFloat:0.0];
      NSNumber *locationTwo = [NSNumber numberWithFloat:1.0];
      NSArray *locationArray = @[locationOne, locationTwo];
  
      CAGradientLayer *gradientLayer = [CAGradientLayer layer];
      gradientLayer.frame = self.view.frame;
      gradientLayer.colors = colorArray;
      gradientLayer.locations = locationArray;
  
      [self.view.layer insertSublayer:gradientLayer atIndex:0];
      //[self.view.layer insertSublayer:gradientLayer above:[self.view.layer.sublayers firstObject]]; // didn't work either
  
      NSLog(@"layers count %lu", self.view.layer.sublayers.count); //returns 3
  }
  </code></pre>
  
  <p>I tried setting the view's background color to <code>clearColor</code>, calling it in the <code>viewDidAppear</code>, but none of them worked. I really don't know what I'm missing. Thanks in any help.</p>