Создать представление разделителя ...
func separatorView(width: CGFloat, inset: CGFloat, color: UIColor?) -> UIView {
let footerView = UIView(frame: CGRect(x: 0, y: 0, width: width, height: 1))
footerView.backgroundColor = color
let insetView = UIView(frame: CGRect(x: footerView.bounds.origin.x, y: footerView.bounds.origin.y, width: inset, height: 1))
insetView.backgroundColor = UIColor.white
footerView.addSubview(insetView)
return footerView
}
Используйте метод делегата табличного представления, чтобы установить представление разделителя
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return separatorView(width: tableView.frame.size.width, inset: tableView.separatorInset.left, color: tableView.separatorColor)
}