title: How can I make my UIImage the same height as the intrinsic height of my UILabel using AutoLayout?
body: <p>I want to use a horizontal stack view to place an icon (UIImage) next to a label (UILabel). I want it so the icon is always the same height as the label's text. If the user increases the system font size, I want the icon to adjust accordingly to remain the same height.</p>
  
  <p>Note the stack view with the icon and label are in a UITableViewCell.</p>
  
  <p>How can I do this?</p>
  
  <p>So far I have the following AutoLayout settings:</p>
  
  <ul>
  <li>UITableViewCell height set to default.</li>
  <li>Stack view constrained to the size of the UITableViewCell.</li>
  <li>Stack view alignment and distribution set to fill.</li>
  <li>UILabel content hugging priority 250 and compression resistance priority 750.</li>
  <li>UIImageView content hugging priority 250 and compression resistance priority 749.</li>
  <li>UIImageView aspect ratio 1:1.</li>
  <li>UIImageView the same height as the UILabel.</li>
  </ul>
  
  <p>All I get is this:
  <a href="https://i.stack.imgur.com/TjUNR.png" rel="noreferrer"><img src="https://i.stack.imgur.com/TjUNR.png" alt="enter image description here"></a></p>
  
  <p>Needless to say I have tried many different combinations but this is the best I get. I want the UIImageView (Facebook logo) to be the same height as 'Some text'.</p>
  
  <p>I want this:
  <a href="https://i.stack.imgur.com/IgCob.png" rel="noreferrer"><img src="https://i.stack.imgur.com/IgCob.png" alt="enter image description here"></a></p>