title: Using auto layout with UIImageView doesn't preserve frame size
body: <p>I would like to implement a <code>UIImageView</code> programmatically but it's not working quite like I expected when I apply auto layout constraints. For simplicity, I've set the frame of the image view to be 100 x 100. This works well, but once I add auto layout constraints the frame size is no longer respected and the image is rendered at its full size (in this case, 320px wide) instead of scaling down to fit within the image view frame.</p>
  
  <p>Why is that and how can I obtain the desired behavior? I wanted a 100x100 image view that would scale the image down respecting the aspect ratio, and located 50 up from the bottom centered in the middle of the screen.</p>
  
  <pre><code>let imageView = UIImageView(frame: CGRectMake(0, 0, 100, 100))
  imageView.image = UIImage(named: "myimg")
  imageView.contentMode = .ScaleAspectFit
  imageView.clipsToBounds = true
  imageView.setTranslatesAutoresizingMaskIntoConstraints(false)
  self.view.addSubview(imageView)
  self.view.addConstraint(NSLayoutConstraint(item: imageView, attribute: .Bottom, relatedBy: .Equal, toItem: self.view, attribute: .Bottom, multiplier: 1, constant: -50))
  self.view.addConstraint(NSLayoutConstraint(item: imageView, attribute: .CenterX, relatedBy: .Equal, toItem: self.view, attribute: .CenterX, multiplier: 1, constant: 0))
  </code></pre>