title: UITableView embedded in other view has wrong position of section header
body: <p>I have a UITableView embedded in another view like so:</p>
  
  <p><img src="https://i.stack.imgur.com/782UV.png" alt="storbyboard showing both parent and embedded view controller"></p>
  
  <p>The navigation controller is displayed modally, so its layout should be full screen and not depend on any other parts of the storyboard.
  If have set up the upper part of the profile view with fixed auto-layout constraints like so:</p>
  
  <ul>
  <li>top layout guide to image view (the gray one): 20pt</li>
  <li>image view to "Transactions" label: 20pt</li>
  <li>"Transactions" label to container view: 20pt</li>
  <li>container view distance to bottom layout guide, leading and trailing space: all 0pt.</li>
  </ul>
  
  <p>So basically, when the screen is larger, the container view should fill the remaining space.</p>
  
  <p>In the container view, I embedded a Table View (including the appropriate controller). To make the issue more visible, I gave the container view a green background and the table view a blue one (that's why the section heading is slightly blue). Of course, I would expect the table view to fill the entire container view. But this only happens partially:</p>
  
  <p><img src="https://i.stack.imgur.com/FbINu.png" alt="app screenshot showing that table view does fill the complete container view, but section header is positioned too low"></p>
  
  <p>So the table view does fill the complete container view (the table view's background color is blue) but the section header is positioned to low. If I scroll down, the section header stays at the same position, but the cells move up and are displayed above it:</p>
  
  <p><img src="https://i.stack.imgur.com/RLJkK.png" alt="app screenshot after scrolling in table view"></p>
  
  <p>I already tried checking and unchecking the "Extended Edges" checkboxes of the table view controller that control whether it extends "Under Top Bars", "Under Bottom Bars" and "Under Opaque Bars", but that did not help. It looks as if the table view leaves space for the navigation bar and status bar, but it shouldn't and I don't understand how I can make it lay out the section header and cells correctly.</p>
  
  <p>Any ideas why that is and how I can fix it?</p>