Okay warning - all untested code
If you assume that the object which knows best how to draw a cell, is the cell itself....
Create a subclass of the Cell
class MyUITableViewCell: UITableViewCell
Now, there are many ways to skin this cell. My preference is to:
Add a method for all of the little things you wish to change in the cell
func configure () {
self.layer.cornerRadius = 5.0 // for instance
}
When should you call configure?
Arguably you could call in in draw() but I like to
Call configure() via the delegate
func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
if cell.responds(to: #selector(MyUITableViewCell.configure()) {
cell.configure()
}
}