title: Adding Rounded Corners to only top of UITableView?
body: <p>I am trying to add rounded corners to only the top corners of my UITableView but the problem is, with the code below, it just makes a black layer over my whole UITableView. How would I fix this?</p>
  
  <pre><code>//Rounded Corners for top corners of UITableView
  UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:thetableView.bounds 
                                                 byRoundingCorners:UIRectCornerTopLeft
                                                       cornerRadii:CGSizeMake(10.0, 10.0)];
  UIBezierPath *maskPath2 = [UIBezierPath bezierPathWithRoundedRect:thetableView.bounds 
                                                 byRoundingCorners:UIRectCornerTopRight
                                                       cornerRadii:CGSizeMake(10.0, 10.0)];
  // Create the shape layer and set its path
  CAShapeLayer *maskLayer = [CAShapeLayer layer];
  maskLayer.frame = thetableView.bounds;
  maskLayer.path = maskPath.CGPath;
  
  CAShapeLayer *maskLayer2 = [CAShapeLayer layer];
  maskLayer.frame = thetableView.bounds;
  maskLayer.path = maskPath2.CGPath;
  
  // Set the newly created shape layer as the mask for the image view's layer
  [thetableView.layer addSublayer:maskLayer];
  [thetableView.layer addSublayer:maskLayer2];
  </code></pre>