title: iOS : How to create a close button that sits on the edge of a UIView with rounded corners (using IB)?
body: <h2>Background:</h2>
  
  <p>I am working on an iPad app that will pop a custom view when the user clicks on an image.
  I want the view to have rounded corners and a close button ( red x in a circle ) that sits on right top edge. </p>
  
  <p>The button in half inside and half outside the view.... Take a look at the Kayak or Zynga Poker apps to see what I am talking about.</p>
  
  <p>Question : If I create the view programmatically and add the button, it works. </p>
  
  <p>However, I really want to user a nib to create the view so I can design the view correctly. So when I call self.layer.maskToBounds = YES on the view ( to create the rounded corners with a radius of 25 ), it clips my button ( since its half in and half out ). How do I retain my button without it getting clipped and still have rounded corners ?</p>