title: Inner shadow effect on UIView layer?
body: <p>I have the following CALayer:</p>
  
  <pre><code>CAGradientLayer *gradient = [CAGradientLayer layer];
  gradient.frame = CGRectMake(8, 57, 296, 30);
  gradient.cornerRadius = 3.0f;
  gradient.colors = [NSArray arrayWithObjects:(id)[RGB(130, 0, 140) CGColor], (id)[RGB(108, 0, 120) CGColor], nil];
  [self.layer insertSublayer:gradient atIndex:0];
  </code></pre>
  
  <p>I'd like to add an <strong>inner shadow</strong> effect to it, but I am not quite sure how to do this. I suppose I would be required to draw in drawRect, however this would add the layer on top of other UIView objects, since it's supposed to be a bar behind some buttons, so I am at a loss as to what to do?</p>
  
  <p>I could add another layer, but again, not sure how to achieve the inner shadow effect (like this:</p>
  
  <p><img src="https://i.stack.imgur.com/MTFCR.png" alt="enter image description here"></p>
  
  <p>Help appreciated...</p>