title: Why masksToBounds = YES prevents CALayer shadow?
body: <p>With the following snippet, I'm adding a drop shadow effect to one my UIView. Which works pretty well. But as soon as I set the view's <strong>masksToBounds</strong> property to <strong>YES</strong>. The drop shadow effect isn't rendered any more.</p>
  
  <pre><code>self.myView.layer.shadowColor = [[UIColor blackColor] CGColor];
  self.myView.layer.shadowOpacity = 1.0;
  self.myView.layer.shadowRadius = 10.0;
  self.myView.layer.shadowOffset = CGSizeMake(0.0f, 0.0f);
  self.myView.layer.cornerRadius = 5.0;
  self.myView.layer.masksToBounds = YES; // &lt;-- This is causing the Drop shadow to not be rendered
  UIBezierPath *path = [UIBezierPath bezierPathWithCurvedShadowForRect:self.myView.bounds];
  self.myView.layer.shadowPath = path.CGPath;
  self.myView.layer.shouldRasterize = YES;
  </code></pre>
  
  <p>Do you have any ideas on this?</p>