title: UItableView automaticDimension not working with UIStackView
body: <p>I want that my <code>UITableViewCell</code> calculates properly its height so its bottom matches the <code>UIStackView</code> bottom.</p>
  <p>I have an understanding that for <code>UITableView.automaticDimension</code> to work you need to set all the vertical constraints of the <code>UITableViewCell</code> so it can calculate its height.</p>
  <p>That's what I'm failing to do. I've made a test project in which I made sure of:</p>
  <ul>
  <li><code>tableView.rowHeight</code> property is set to <code>UITableView.automaticDimension</code>.</li>
  <li>To not implement function <code>heightForRowAt</code>.</li>
  <li><code>TableViewCell</code> <code>Row Height</code> is set to <code>Automatic</code> in the xib file.</li>
  <li>All views are constrained vertically.</li>
  <li>To play with <code>UIStackView</code> <code>distribution</code> property.</li>
  <li>To set the <code>UIStackView</code> bottom constraint to the <code>superView</code> to <code>Less Than or Equal</code> (with this items are too tiny and with <code>Greater Than or Equal</code>, or <code>Equal</code>, item's height is equal to screen width since they have <code>aspect ratio</code> 1:1</li>
  <li>To play with <code>Content Hugging Priority</code> and <code>Content Compression Resistance Priority</code>. In the test all views have default values, for hugging horizontal and vertical 250, and for compression horizontal and vertical 750.</li>
  </ul>
  <p>The code:</p>
  <pre><code>import Foundation
  import UIKit
  
  class IBAutomaticDimensionTableViewViewController: UIViewController, UITableViewDelegate, UITableViewDataSource  {
      
      @IBOutlet private weak var tableView: UITableView!
      
      override func viewDidLoad() {
          super.viewDidLoad()
          
          tableView.rowHeight = UITableView.automaticDimension
          tableView.register(
              IBAutomaticDimensionTableViewCell.nib,
              forCellReuseIdentifier: IBAutomaticDimensionTableViewCell.nibName
          )
          tableView.delegate = self
          tableView.dataSource = self
          tableView.reloadData()
  //        view.layoutIfNeeded() Not working with or without it
      }
      
      func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
          return 5
      }
      
      func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
          let cell = tableView.dequeueReusableCell(
              withIdentifier: IBAutomaticDimensionTableViewCell.nibName,
              for: indexPath
          ) as! IBAutomaticDimensionTableViewCell
          return cell
      }
  }
  </code></pre>
  <p>The cell's xib file:
  <a href="https://i.stack.imgur.com/vyNt4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vyNt4.png" alt="The cell's xib file" /></a></p>
  <p>Result with <code>Less Than or Equal</code> bottom constraint:</p>
  <p><a href="https://i.stack.imgur.com/e7jQr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/e7jQr.png" alt="Result with Less Than or Equal bottom constraint" /></a></p>
  <p>Result with <code>Greater Than or Equal</code> or <code>Equal</code> bottom constraint:</p>
  <p><a href="https://i.stack.imgur.com/b7Q1H.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b7Q1H.png" alt="Result with Greater Than or Equal or Equal bottom constraint" /></a></p>