I was trying to create rounded corner for tableview using UIBezierPath and its not working and so far the better way seems to be have the tableview inside a view and round the corner for the view rather than tableview.
Does anybody have a better way of doing it
To round the UITableView's corners,
1. Make sure UITableViewCell's clipToBounds is selected in Storyboard.
2. Make sure UITableView's clipToBounds is selected in Storyboard.

3. Set cornerRadius value of UITableView's layer, i.e.
@IBOutlet weak var tableView: UITableView!
override func viewDidLoad()
{
    super.viewDidLoad()
    self.tableView.layer.cornerRadius = 10.0
}
Screenshot:

If you need rounded corners for your table view rows check this link
For Objective-c:--
   cell.contentView.layer.cornerRadius = 5;
   cell.contentView.layer.masksToBounds = YES;
For Swift:--
cell.contentView.layer.cornerRadius = 5
cell.contentView.layer.masksToBounds = true
For whole tableview try this link
#import <QuartzCore/QuartzCore.h>
 self.tableView.layer.borderColor = [UIColor colorWithWhite:0.6 alpha:1].CGColor;   
 self.tableView.layer.borderWidth = 1;
 self.tableView.layer.cornerRadius = 4;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With