I am currently trying to put a UITableView in a different location rather than at the top of my view controller. With this said, it is trying to add the header
In iOS 11 and above, apple has changed property to adjust content inset. Use contentInsetAdjustmentBehavior and set .never to remove extra space above UICollectionView, UIScrollView, UITableView.
if #available(iOS 11.0, *) {
// For scroll view
self.scrollView.contentInsetAdjustmentBehavior = .never
// For collection view
self.collectionView.contentInsetAdjustmentBehavior = .never
// For table view
self.tableView.contentInsetAdjustmentBehavior = .never
} else {
self.automaticallyAdjustsScrollViewInsets = false
}
I hope this will help you.