title: Center UImage with AutoLayout in Xcode
body: <p>I'm using a Launch Screen.xib file for the launch screen of my iOS app.
  The app can be used in portrait mode only for iPhone and landscape mode only for iPad.</p>
  
  <p>As a launch screen, I'm using an UImageView. For the portrait mode, I want the image to have a maximum width, and for landscape mode, I want it to have maximum height. It's a square image (512 by 512px), and the ratio has to be preserved.</p>
  
  <p>Does anyone know how to do this in AutoLayout using constraints? I can make it work for one orientation, but it's messed up for the other one.</p>