title: Launch screen storyboard constraints in iOS Universal app
body: <p>I'm working on a <code>LaunchScreen.storyboard</code> file for an iOS Universal app in Xcode 7.3.</p>
  
  <p>I must use only constraints defined in storyboard, because the launch screen will be shown before the app will be loaded (can't configure constraints programmatically in a <code>UIViewController</code> subclass).</p>
  
  <p>The background image in the main <code>UIViewController</code> has</p>
  
  <ul>
  <li>aspect-ratio (<code>3456:2592</code>),</li>
  <li>center vertically and</li>
  <li>center horizontally constraints.</li>
  </ul>
  
  <p>I'm trying to obtain the following conditions:</p>
  
  <ul>
  <li>maintain the background image aspect-ratio,</li>
  <li>activate <code>backgroundImageView.Top = containerView.Top</code> when <strong><em>screen width &lt;= screen height</em></strong>
  <a href="https://i.stack.imgur.com/oGgxT.png" rel="noreferrer"><img src="https://i.stack.imgur.com/oGgxT.png" alt="enter image description here"></a></li>
  <li>activate <code>backgroundImageView.Leading = containerView.Leading - 20</code> when <strong><em>screen width > screen height</em></strong>
  <a href="https://i.stack.imgur.com/du9ox.png" rel="noreferrer"><img src="https://i.stack.imgur.com/du9ox.png" alt="enter image description here"></a></li>
  </ul>
  
  <p>The problem is that storyboard constraint definition by size classes is not powerful enough to express conditions like <strong><em>screen width >/&lt;= screen height</em></strong> (e.g.: an iPad Air Fullscreen has always regular width and height, but <strong><em>screen width &lt; screen height</em></strong> in portrait mode and <strong><em>screen width > screen height</em></strong> in landscape mode).</p>
  
  <p>I tried also to define the background image asset set by device, but it allows only to specify iPhone/iPad x1, x2 and x3 versions of the image.</p>