UITableView : sectionHeaderHeight from StoryBord not returned
<p>I am translating from XCode 7.3 to Xcode 8.1 and from swift 2 to Swift 3.
I haven't change anything. In my project I have a UITableView with 2 sections. I have set a height of 28 in the storyboard for the sections.
<a href="https://i.stack.imgur.com/AxdHk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AxdHk.png" alt="enter image description here"></a>
<a href="https://i.stack.imgur.com/4qVSF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4qVSF.png" alt="enter image description here"></a></p>

<p>When I ran on Xcode 7.3, my 2 section headers appear correctly but they disappear with Xcode 8.1. The reason is that I have this function</p>

<pre><code>func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -&gt; CGFloat {
    return (tableView.dataSource?.tableView(tableView, numberOfRowsInSection: section) &gt; 0) ? tableView.sectionHeaderHeight : 0
}
</code></pre>

<p>When I inspect the value of tableView.sectionHeaderHeight, it is set at -1 instead of 28.</p>

<p>I have also this function</p>

<pre><code>func numberOfSectionsInTableView(tableView: UITableView) -&gt; Int {
    return 2
}
</code></pre>