I have a `UITableViewCell` containing only a label inside it. The label is constrained to all the margins of the cell (top, bottom, trailing and leading). It is a multiline label (lines = 0) and has some static text, which will occupy multiple lines on the iPhone X's screen in both landscape and portrait.

Here's a [screenshot](https://i.stack.imgur.com/fdfp1.png) of the IB with the constraints.

![](https://i.stack.imgur.com/fdfp1.png)

Number of rows is set in code to 30. (Enough cells to always occupy the screen)

I have implemented all of the above in a new project. Most of it is done on the IB and the `UITableViewController` subclass only contains two methods, `numberOfRowsInSection` and `cellForRowAt indexPath`. The project was created on Xcode 9 with Swift 4 and the device is running on iOS 11.2.

Heres the code for the `UITableViewController` subclass

```
class ViewController: UITableViewController {

    override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 30
    }

    override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
        return cell
    }
}

```

When the VC first launches, all the cells are sized properly. On rotating the device to landscape, the cells resize as expected. Now, when I rotate the device back to portrait the **cells occupy a larger height than they should**.

**This only occurs on the iPhone X**. The cells are laid out as expected on all other iPhones.

Also, this does not happen on any of my older projects (created using Xcode 8).

[When the VC launches](https://i.stack.imgur.com/ijHYK.png)

[After rotating to landscape and back](https://i.stack.imgur.com/uIhs3.png)

![before](https://i.stack.imgur.com/ijHYK.png) ![after](https://i.stack.imgur.com/uIhs3.png)

I have been trying replicate all the attributes from my older project, but it still doesn't size properly.

Any input would be appreciated...
Thanks!

**EDIT:**

As Brandon pointed out, it only occurs when a `UITableViewController` is embedded in a `UINavigationController`. A `UITableView` in a `UIViewController` embedded inside a `UINavigationController` shows the correct behavior. And a `UITableViewController` outside a `UINavigationController` also behaves as expected.