Reputation: 12145
Why do I have margin before first table view section?
Is it not supposed to be only between sections?
Upvotes: 0
Views: 33
Reputation: 1569
Overriding
tableView (_tableView: UITableView, heightForHeaderInSection section: Int)
You will get the behavior you want at runtime. If you need to change the values according to the section, you need to do it manually by testing which section you are in.
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat
{
if section == 0 {
return CGFloat.leastNormalMagnitude
}else{
return 44
}
}
Upvotes: 1