title: How to set autolayout constraint so that the height of an UIImageView is equal to the height of the superview?
body: <p>I have created a <code>UIView</code> that consists of 3 <code>UILabel</code>s and 1 <code>UIImageView</code> as below - </p>
  
  <p><a href="https://i.stack.imgur.com/HF1Al.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HF1Al.png" alt="View"></a></p>
  
  <p>The <code>UILabel</code>s have <code>lines</code> set to 0 so that the height of the <code>UILabel</code>s change dynamically</p>
  
  <p>I have added constraints such that the height of the image depends on the height of the <code>UILabel</code>s as shown below - </p>
  
  <p><a href="https://i.stack.imgur.com/AKTZL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AKTZL.png" alt="enter image description here"></a></p>
  
  <p>I have set width of the <code>UIImageView</code> to a constant of 100.</p>
  
  <p>I would like to set a constraint on <code>UIImageView</code> such that the height of the <code>UIImageView</code> is equal to the height of the whole view.</p>
  
  <p>I tried adding a "Equal Heights" constraint on the <code>UIImageView</code> and the whole view. I observed that the height of the whole view depends on the height of the <code>UIImageView</code> and not that the height of the <code>UIImageView</code> depends on the whole view as I want it to be.</p>
  
  <p>Can anyone point out how I can add a constraint to the <code>UIImageView</code> such that its height is equal to its superview but the height of the superview is not dependent on the <code>UIImageView</code>?</p>
  
  <p>Edit - 
  The below image shows the problem that I am facing. When an image is set to the <code>UIImageView</code>, the height of the view changes. 
  I want the height of the <code>UIImageView</code> to be equal to the height of the view, but I do not want the height of the view to be dependent on height of the <code>UIImageView</code></p>
  
  <p><a href="https://i.stack.imgur.com/LQzpn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LQzpn.png" alt="enter image description here"></a></p>