title: NSView with gradient background AND shadow
body: <p>I want my NSView to have both gradient background and shadow, so I subclassed <code>NSView</code> and overrode the <code>- (void)awakeFromNib</code> method like this:</p>
  
  <pre><code>[self setWantsLayer:YES]; // view's backing store is using a Core Animation Layer
  
  CAGradientLayer *backgroundGradient = [[CAGradientLayer alloc] init];
  backgroundGradient.colors = @[
      (__bridge id)CGColorCreateGenericGray(0.85, 1.0),
      (__bridge id)CGColorCreateGenericGray(0.94, 1.0)
  ];
  backgroundGradient.masksToBounds = NO;
  
  CALayer *shadowLayer = [CALayer layer];
  shadowLayer.shadowColor = CGColorCreateGenericGray(0.5, 1.0);
  shadowLayer.shadowOffset = NSMakeSize(0, 0.0);
  shadowLayer.shadowRadius = 10.0;
  shadowLayer.shadowOpacity = 1.0;
  shadowLayer.masksToBounds = NO;
  
  [backgroundGradient addSublayer:shadowLayer];
  
  [self setLayer:backgroundGradient];
  </code></pre>
  
  <p>However, only the gradient was shown. In addition, if I try <code>[self setLayer:shadowLayer]</code> then the shadow is shown (but of course, no gradient).</p>
  
  <p>How to show both the gradient and the shadow? Thanks a lot! </p>