title: NSLayoutConstraint programmatically set view frame
body: <p>I know there is are similar topics, but i cant figure out how to do simple thing, for example, set view frame programmatically with Auto Layout constraints. Its pretty easy to do with Storyboard, but when i try to learn about NSLayourConstraint i realise that i'm not understand topic.</p>
  
  <p>Consider that we have UIView and 3 buttons. First button at top have 3 constraints (leading and trailing, and to top of a view). Other 2 buttons centered horizontally with that button and have equal widths. its pretty easy layout, i upload screenshot:</p>
  
  <p><a href="https://i.stack.imgur.com/lKloJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lKloJ.png" alt="enter image description here"></a></p>
  
  <p>I have read about visual format language, but what i cant understand is - how to create constraint, for example, that relay to top (or trailing-leading)? Like following:
  <a href="https://i.stack.imgur.com/lM3Wn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lM3Wn.png" alt="enter image description here"></a></p>
  
  <p>Task look pretty simple but still, i did not found a way how to do that programmatically with <code>NSLayoutConstraint</code>. Could you please provide a solution? Thanks.</p>