swiftuikit

UITableView remove padding cells


I want to completely paint the background of some cells with black. I do it like this.

cell.layer?.backgroundColor = CGColor.init(red: 0.0, green: 0.0, blue: 0.0, alpha: 1.0)

But this is what I get. How do I remove padding inside cells? I want a solid black fill between cells.

enter image description here


Solution

  • tableView.intercellSpacing = NSSize(width: 0.0, height: 0.0)