title: Setting up variable constrains in xcode
body: <p>I'm having trouble setting up constraints.</p>
  
  <p>This is the thing I am trying to achieve:
  <a href="https://i.stack.imgur.com/BqEoq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BqEoq.png" alt="screen shot"></a></p>
  
  <p>I have 2 objects A and B. I want there there to be a maximum of 100 points between A and B if its a larger screen, or less if its a smaller screen.</p>
  
  <p>Also, I want there to be a minimum of a 20 point margin from the main view controller. So on a smaller screen the minimum spacing will be 20 points, and on a larger screen the margin can be as wide as needs in order to satisfy the space between A and B at 100 points.</p>
  
  <p>To illustrate how I want it to look on various screens:</p>
  
  <p><strong>4 inch screen</strong></p>
  
  <p><a href="https://i.stack.imgur.com/rANmS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rANmS.png" alt="enter image description here"></a></p>
  
  <p>I want there to be a 20 point margin on either side and the middle (space between A and B) can be variable, i.e. 100 or less.</p>
  
  <p><strong>5.5 inch screen</strong></p>
  
  <p><a href="https://i.stack.imgur.com/nHvw2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nHvw2.png" alt="enter image description here"></a></p>
  
  <p>The margins can be variable and expand as large as they need to, but the middle section (space between A and B) can be a maximum of 100.</p>
  
  <p>Any help how to achieve this would be greatly appreciated.</p>