Space Between Sections in UITableview

I need to reduce the space between two sections ofUITableView. I looked at this question but the solution doesn't allow for my custom header view because it combines the space of the footer and header.

Here is a picture of the UITableView. The black color is the UITableView background color.

tableview screenshot


  • Did you try override this function:

    override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
        return .leastNormalMagnitude