title: Can't add a corner radius and a shadow
body: <p>I'm trying to draw a shadow and a corner radius on an image. I can add them separately, but I've got no way to add both effects at the same time. I'm adding a shadow with:</p>
  
  <pre><code>[layer setShadowOffset:CGSizeMake(0, 3)];
  [layer setShadowOpacity:0.4];
  [layer setShadowRadius:3.0f];
  [layer setShouldRasterize:YES];
  </code></pre>
  
  <p>Here, layer is a CALayer of a UIView subclass. So this works whenever I set </p>
  
  <pre><code>[layer setMasksToBounds:NO];
  </code></pre>
  
  <p>Now to add a corner radius I do this:</p>
  
  <pre><code>[layer setCornerRadius:7.0f];
  </code></pre>
  
  <p>but I need to set MasksToBounds to YES in order for this to work:</p>
  
  <pre><code>[layer setMasksToBounds:YES];
  </code></pre>
  
  <p>Is there anyway I can get both of these effects to add? </p>
  
  <p>Thanks for your time,</p>
  
  <p>Denis</p>