I was experiencing an issue on iOS 11 where there was a gap above the scroll view before the navigation bar. The solution for me was the following code. It seems that in addition to the content inset TLY was adding, iOS was then adding another inset which can be seen in the new variable adjustedContentInset
https://developer.apple.com/documentation/uikit/uiscrollview/2902259-adjustedcontentinset
This was my solution
if (@available(iOS 11.0, *)) {
self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}