title: UITableViewCell doesn't update height after adding a view to UIStackView
body: <p>I have a <code>UIStackView</code> inside <code>UITableViewCell</code>'s <code>contentView</code>. Based on user interaction, I add/remove items in the <code>UIStackView</code>. After modifying the items in <code>UIStackView</code>, I expect the <code>cell</code> to update it's height accordingly. But, it doesn't update it's height unless I call <code>tableView.reloadData()</code>. But, calling <code>reloadData()</code> in <code>cellForRowAtIndexPath</code> / <code>willDisplayCell</code> becomes recursive.</p>
  
  <p>What is the proper way to adjust the <code>cell</code> height at run time based on items in <code>UIStackView</code>?</p>
  
  <p>I use <code>UITableViewAutomaticDimension</code></p>
  
  <p><strong>Updating the Problem:</strong></p>
  
  <p><a href="https://www.dropbox.com/s/xqfhxhzft1z7sd8/StackViewInCell.zip?dl=0" rel="nofollow noreferrer">Here</a> is a simple prototype of what I am trying to do.</p>
  
  <p>My actual problem is dequeuing the cell. </p>
  
  <p>In the prototype, I have 2 reusable cells and 3 rows. For row 0 and 2, I dequeue <code>cellA</code> and for row 1, I dequeue <code>cellB</code>. Below is the overview on the condition I use.</p>
  
  <pre><code>if indexPath.row == 0 {
      // dequeue cellA with 2 items in stackView
  }
  
  if indexPath.row == 1 {
      // dequeue cellB with 25 items in stackView
  }
  
  if indexPath.row == 2 {
      // dequeue cellA with 8 items in stackView
  }
  </code></pre>
  
  <p>But the output is, 
  row 0 contains 2 items in <code>stackView</code> - expected
  row 1 contains 25 items in <code>stackView</code> - expected
  row 2 contains 2 items in <code>stackView</code> - unexpected, row 0 is dequeued</p>
  
  <p>I also tried removing all arranged subViews of <code>stackView</code> in <code>cellForRowAtIndexPath</code>. But, doing so, flickers the UI when scrolling. How can I manage to get the desired output?</p>