title: Growing and shrinking table views with auto-layout
body: <p>I am trying to build a view that holds several table views stacked vertically. Rather than assign each table view a fixed height, I want the tables to grow with their content. The stack is then nested in a scrollview.</p>
  
  <p>Using auto-layout, I managed to get the nested scroll views grow with their table views. I however cannot get these to shrink as I remove rows from the table view. Auto-layout seems to assume that the best size for a view is its current size. In my set-up the best size would be the smallest fitting size.</p>
  
  <p>The set-up in Interface builder:</p>
  
  <pre><code>- Scrollview
  -- Clipview
  --- Container
  ---- Nested Scrollview
  ------ Clipview
  ------- Tableview
  ---- Nested Scrollview
  ------ Clipview
  ------- Tableview
  </code></pre>
  
  <p>In code I add constraints to pin the leading, trailing, top and bottom of the table views to their immediate parent clip views.</p>
  
  <p>The test project ( <a href="https://dl.dropboxusercontent.com/u/2381634/SO/AdjacentTableViews%20Auto-Layout.zip" rel="nofollow">https://dl.dropboxusercontent.com/u/2381634/SO/AdjacentTableViews%20Auto-Layout.zip</a> ) has buttons to add and remove rows from the two table views.</p>
  
  <p>Adding rows grows the table views, the clip views,…. The outer scull view can scroll as expected.</p>
  
  <p>Removing rows fails to shrink the nested scroll views.</p>
  
  <p>How can I have auto-layout consider the minimum fitting size, hug content, … ?</p>