title: Objective c - Draw image with rounded corners in drawRect
body: <p>I have a <code>UITableViewCell</code> subclass with a <code>UIImage</code> as property.<br>
  I want to draw the image in drawRect, and to be efficient because this is a table view cell.  </p>
  
  <p>I know how to draw the image as it is:  </p>
  
  <pre><code>-(void)drawRect:(CGRect)aRect 
  {
      CGRect rect = self.bounds;
  
      [self.image drawInRect:rect];
  } 
  </code></pre>
  
  <p>But how can I draw the image with rounded corners, and stay efficient? </p>
  
  <p>BTW I don't want to use <code>UIImageView</code> and then set the layer corner radius because it seams to  hurt performance.</p>