title: Creating Auto Layout constraints to topLayoutGuide and bottomLayoutGuide in code
body: <p>Apple's <a href="https://developer.apple.com/library/ios/documentation/uikit/reference/UIViewController_Class/index.html#//apple_ref/occ/instp/UIViewController/topLayoutGuide" rel="noreferrer">documentation</a> on creating Auto Layout constraints between a view and one of the layout guides only shows an example using <a href="https://developer.apple.com/library/mac/documentation/userexperience/conceptual/AutolayoutPG/Articles/formatLanguage.html" rel="noreferrer">VFL</a>.</p>
  
  <p>Is there any way to create these constraints programmatically <strong>without</strong> VFL (using <a href="https://developer.apple.com/library/mac/documentation/AppKit/Reference/NSLayoutConstraint_Class/index.html#//apple_ref/occ/clm/NSLayoutConstraint/constraintWithItem:attribute:relatedBy:toItem:attribute:multiplier:constant:" rel="noreferrer"><code>NSLayoutConstraint</code>'s other API</a> or similar)?</p>
  
  <p>(Note: I'm specifically asking about doing this in code, not in Interface Builder. And I don't want the calculated <code>length</code> of the guide set as a static constant on a constraint, I want a constraint where changes to the layout guide length would automatically cause the constrained view to adjust position.)</p>