title: iOS - Autolayout issue in table view cell
body: <p>I have a table view cell with the following items:</p>
  
  <ul>
  <li>Image View (343 x 193)</li>
  <li>Label 1 (height: 17)</li>
  <li>Label 2 (height: 20)</li>
  </ul>
  
  <p>I want the image to maintain the same aspect ratio no matter what the device is (this app only works on iPhone, not on iPad). What I'm doing is adding the following:</p>
  
  <ul>
  <li><p>Image View: Aspect Ratio contraint; top, left, right contraints</p></li>
  <li><p>Label 1: Height constraint; top (in respect to image view), left,<br>
  right contraints; equal widths (with image view)</p></li>
  <li><p>Label 2: Height constraint; top (in respect to image view), left,<br>
  right, bottom (in respect to cell) contraints; equal widths (with<br>
  image view)</p></li>
  </ul>
  
  <p>When I test this I get the following</p>
  
  <pre><code>2018-04-14 11:50:33.457531-0500 MyAppIOS[4357:479920] [LayoutConstraints] Unable to simultaneously satisfy constraints.
      Probably at least one of the constraints in the following list is one you don't want. 
      Try this: 
          (1) look at each constraint and try to figure out which you don't expect; 
          (2) find the code that added the unwanted constraint or constraints and fix it. 
  (
      "&lt;NSLayoutConstraint:0x60000009f9a0 UIImageView:0x7ff04952dfb0.width == 1.7772*UIImageView:0x7ff04952dfb0.height   (active)&gt;",
      "&lt;NSLayoutConstraint:0x60000009fc70 UILabel:0x7ff04952e1e0.height == 17   (active)&gt;",
      "&lt;NSLayoutConstraint:0x60000009fd60 UILabel:0x7ff04952e940'Loading...'.height == 20   (active)&gt;",
      "&lt;NSLayoutConstraint:0x60000009fea0 V:|-(10)-[UIImageView:0x7ff04952dfb0]   (active, names: '|':UITableViewCellContentView:0x7ff04952d770 )&gt;",
      "&lt;NSLayoutConstraint:0x60000009fef0 H:[UIImageView:0x7ff04952dfb0]-(16)-|   (active, names: '|':UITableViewCellContentView:0x7ff04952d770 )&gt;",
      "&lt;NSLayoutConstraint:0x60000009ff40 H:|-(16)-[UIImageView:0x7ff04952dfb0]   (active, names: '|':UITableViewCellContentView:0x7ff04952d770 )&gt;",
      "&lt;NSLayoutConstraint:0x60000009ff90 V:[UIImageView:0x7ff04952dfb0]-(8)-[UILabel:0x7ff04952e1e0]   (active)&gt;",
      "&lt;NSLayoutConstraint:0x600000280140 V:[UILabel:0x7ff04952e1e0]-(8)-[UILabel:0x7ff04952e940'Loading...']   (active)&gt;",
      "&lt;NSLayoutConstraint:0x6000002801e0 V:[UILabel:0x7ff04952e940'Loading...']-(10)-|   (active, names: '|':UITableViewCellContentView:0x7ff04952d770 )&gt;",
      "&lt;NSLayoutConstraint:0x60800009c070 'UIView-Encapsulated-Layout-Height' UITableViewCellContentView:0x7ff04952d770.height == 266   (active)&gt;",
      "&lt;NSLayoutConstraint:0x60800009e230 'UIView-Encapsulated-Layout-Width' UITableViewCellContentView:0x7ff04952d770.width == 375   (active)&gt;"
  )
  
  Will attempt to recover by breaking constraint 
  &lt;NSLayoutConstraint:0x60000009fd60 UILabel:0x7ff04952e940'Loading...'.height == 20   (active)&gt;
  </code></pre>
  
  <p>So basically it's saying that it will modify the height of the second label to accommodate.</p>
  
  <p>Is there a better way to set up these constraints? Should I have more/less than the ones I'm using?</p>