I have an UITableView
(style = UITableView.Style.plain
) with rather simple cells. In IB I set cell's separator inset as custom:
Also, I set table section header as follows:
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let label = UILabel()
label.textAlignment = .center
label.backgroundColor = .white
label.text = "My table section"
return label
}
The result is:
I want to remove separator between "My table section" and "cell 0". How do I fix it?
This is the default separator of the tableview if you don't want it you can set it to none.
And if you want separators under the cell you have to make one by yourself. Just add a view in your cell under the label and give its constraints like leading-trailing top-bottom and height(how much thick separator you want in my opinion maybe 1.5), that should do the job.