Make sure that you don’t have any header added.
If you are using a nib/storyboard checkout the ViewController design -> Select tableview -> set Footer height
& Header height
to 0.
If you are using code, checkout this example on how to remove the header using code - How to hide first section header in UITableView (grouped style)
By default it will take 28 that's why it shows blank on top.
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 0
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 0
}
set above code and make sure delegate method will call.