Search code examples
swift4swift5

How to get rid of an empty UITableCell appearing top and in between tableview


I used below lines of code to get rid of the empty UITableview cells but no luck. Any help is appreciated.

tableView.tableFooterView = UIView()
tableView.tableHeaderView = UIView()

Solution

  • You should use nil instead of UIView()

    tableView.tableHeaderView = nil