When iPhone X is used landscape, you\'re supposed to check safeAreaInsets to make suitably large gutters on the left and right. UITableView has the new insetsContentViewsT
Having the same issue. This worked for me:
override func viewDidLoad() {
if #available(iOS 11.0, *) {
collectionView?.contentInsetAdjustmentBehavior = .always
}
}
The documentation for the .always enum case says:
Always include the safe area insets in the content adjustment.
This solution works correctly also in the case the phone is rotated.