title: UIViewController: extendedLayoutIncludesOpaqueBars and scroll view offset
body: <p>My app's view hierarchy is pretty straightforward: a <code>UINavigationController</code> contains a <code>UITableViewController</code>. The navigation controller's navigation bar is opaque, which causes some strange inset behavior of the table view during navigation transitions, seen here:</p>
  
  <p><a href="https://i.stack.imgur.com/jcPkt.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/jcPkt.gif" alt="Navigation Inset Issue"></a></p>
  
  <p>To remedy this, I'm setting <code>extendedLayoutIncludesOpaqueBars</code> to <code>true</code> on the <code>UITableViewController</code>. Doing so properly extends the view beneath the navigation bar, but changes the behavior of the table view's <code>contentOffset</code> in a way that I don't quite understand. With this property set to <code>true</code>, the Y-value of the table view's <code>contentOffset</code> reports that it is offset higher than it should be by the current height of the navigation bar (i.e. scrolling the table view 1pt, it reports that its y-offset is -63pts).</p>
  
  <p>This made me think that the navigation controller was automatically managing the scroll view's <code>contentInset</code>, like it does for translucent bars. But I couldn't see any evidence that the scroll view had content insets set in <code>scrollViewDidScroll()</code>. Even with <code>automaticallyAdjustsScrollViewInsets</code> set to <code>false</code> on the table view controller, the content offset wasn't right, so it seems it's nothing to do with the insets.</p>
  
  <p><a href="https://developer.apple.com/documentation/uikit/uiviewcontroller/1621404-extendedlayoutincludesopaquebars" rel="noreferrer">Apple's documentation about <code>extendedLayoutIncludesOpaqueBars</code></a> doesn't mention any effect on the behavior of a scroll view's content offset. Changing the <code>contentInset</code> of the table view unfortunately doesn't solve this.</p>
  
  <p>I tried changing the table view controller's <code>edgesForExtendedLayout</code> property to force it to extend without affecting the scroll view, but it seems this property is powerless against opaque bars.</p>
  
  <p>Is there some hidden behavior with <code>extendedLayoutIncludesOpaqueBars</code> that borks up a scroll view's content offset? Or could this be a bug?</p>