To change header/footer space the following methods have to be implemented:
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView?
AND
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat
(use corresponding methods to change footer height)
The following code completely removes spaces around sections:
public func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return nil
}
public func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return nil
}
public func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return .leastNonzeroMagnitude
}
public func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return .leastNonzeroMagnitude
}