title: AutoLayout: Variable height UITableViewCell containing stacked UILabel and UIImageView
body: <p>I'm trying without success to create a <code>UITableViewCell</code> (in code, no interface builder) where the cells height expands to fit it's contents. The contents being, a <code>UILabel</code> which itself expands given the text. And an <code>UIImageView</code> that should also expand to to enable it till be filled with an image (maintaining aspect ratio). So a panoramic image might result in a short height, while a portrait image, will make the image much taller. The image is downloaded, so we might not know the dimensions at first.</p>
  
  <p>Even if I set a constraint to fix the image view to a 4:3 aspect, resulting in a fixed image, the constraint on the cell seems to see the height as zero instead, thus the label sits on top of the image. The image overlaps the cells above and below it.  Just to get it to work, in my example I'm just using a static image resource rather than downloading an image.</p>
  
  <p>I'm using a VFL on the cells containerView:</p>
  
  <pre><code>V:|-[image]-[label]-|
  </code></pre>
  
  <p><strong>What could be causing the image height to be treated as zero/ignored?</strong></p>
  
  <p><img src="https://i.stack.imgur.com/adTEh.png" alt="enter image description here"></p>