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()
You should use nil
instead of UIView()
tableView.tableHeaderView = nil