title: How to keep a round imageView round using auto layout?
body: <p>How do I turn a rectangular image view into a circular image view that can hold shape in auto layout without setting width and height restraints? Thereby allowing the imageView to define it’s size, and size bigger and smaller relative to objects around it with leading, trailing, top, and bottom constraints.</p>
  
  <p>I asked a similar question the other day, but I think this might be posed in a more concise way. Thanks so much!</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Ok, I started over to make this as simple as possible. I have a view named "Cell" and a UIImageView named "dog" within the cell, and that's it. I don't have "unable to simultaneously satisfy constraints" in the console anymore, just two simple views using auto layout. I'm still trying to use this code to round the UIImageView:</p>
  
  <pre><code>profileImageView.layer.cornerRadius = profileImageView.frame.size.width / 2
  profileImageView.clipsToBounds = true
  </code></pre>
  
  <p>Here is the cell constraint setup:</p>
  
  <p><a href="https://i.stack.imgur.com/W7ZOX.png" rel="noreferrer"><img src="https://i.stack.imgur.com/W7ZOX.png" alt="screenshot 1"></a></p>
  
  <p>Here is the profile pic constraint setup:</p>
  
  <p><a href="https://i.stack.imgur.com/EtoPL.png" rel="noreferrer"><img src="https://i.stack.imgur.com/EtoPL.png" alt="screenshot 2"></a></p>
  
  <p>Here is the result without the code, no rounding, but nice and square:</p>
  
  <p><a href="https://i.stack.imgur.com/97L3V.png" rel="noreferrer"><img src="https://i.stack.imgur.com/97L3V.png" alt="screenshot 3"></a></p>
  
  <p>Here is the result with the code to round:</p>
  
  <p><a href="https://i.stack.imgur.com/4w9uI.png" rel="noreferrer"><img src="https://i.stack.imgur.com/4w9uI.png" alt="screenshot 4"></a></p>
  
  <p>This makes no sense to me, because without the rounding code the image is square, and with the code it's diamond shaped. If it's square shouldn't it be a circle with no issues?</p>
  
  <p><strong>EDIT 2</strong></p>
  
  <p>Here's what happens when I remove the bottom constraint and add a multiplier of .637 for equal height to superview.</p>
  
  <p><a href="https://i.stack.imgur.com/3xhEa.png" rel="noreferrer"><img src="https://i.stack.imgur.com/3xhEa.png" alt="screenshot 5"></a></p>