Search code examples
xcodeuitableviewrounded-corners

UITableView Cells Separated and with Rounded Corners


The title may seem odd but I am trying to make a to-do list app where the tasks are in a UITableView that looks like Wunderlist's where it doesn't touch the edges and has rounded corners with spacing between each task. I am new to Xcode and cannot find any answers online.


Solution

  • Create view inside a tableview cell and set its bottom constraint to the space you want to give and on that view apply corner radius using

    view.layer.cornerRadius = 10; view.layer.masksToBounds = true;