title: TableViewCell going out of bounds in the TableView
body: <p>I have a table view and inside that I have added a cell which has label on the right side of of the view. </p>
  
  <p>Here is how my cell looks:
  <a href="https://i.stack.imgur.com/Qvn5Z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Qvn5Z.png" alt="enter image description here"></a></p>
  
  <p>But when I am running the application, this is what I get. (It is being run on iPhone 6S):</p>
  
  <p><a href="https://i.stack.imgur.com/nBQHz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nBQHz.png" alt="enter image description here"></a></p>
  
  <p>As you can see, the label is being pushed out. </p>
  
  <p>The result on iPhone XR are fine. Here is the screenshot for XR:
  <a href="https://i.stack.imgur.com/3KRUm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3KRUm.png" alt="enter image description here"></a></p>
  
  <p>Here is the code for the view controller where the table view delegates are: </p>
  
  <pre><code>import UIKit
  
  class TableViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
  
  @IBOutlet var tableView: UITableView!
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
      tableView.dataSource = self
      tableView.delegate = self
      tableView.separatorStyle = .none
  
      let headerViewNibName = UINib(nibName: "HeaderCell", bundle: nil)
      tableView.register(headerViewNibName, forCellReuseIdentifier: "headerCell")
  }
  
  func  tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
      return 1
  }
  
  func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
      if indexPath.row == 0 {
          let cell = tableView.dequeueReusableCell(withIdentifier: "headerCell", for: indexPath) as! HeaderCell
          cell.isUserInteractionEnabled = false
          return cell
      }
  
      return UITableViewCell()
  }
  
  func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -&gt; CGFloat {
      if indexPath.row == 0 {
          return 138
      }
  
      return 0
  }
  
  }
  </code></pre>
  
  <p>Can someone please explain why this is happening?</p>
  
  <p>Edit: </p>
  
  <p>Attaching screenshot for cell view with constraints visible:
  <a href="https://i.stack.imgur.com/9ffET.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9ffET.png" alt="enter image description here"></a></p>