title: How can I display views using autolayout constraints in Xcode playground?
body: <p>I am trying to display views configured with <strong>autolayout</strong> constraints in XCode <strong>playground</strong>, but it doesn't seem to work. It's like playground ignores the constraints completely, and I can't find information about this issue anywhere.</p>
  
  <p>Here's the code I tried:</p>
  
  <pre><code>let view = UIView()
  view.frame = CGRectMake(0, 0, 400, 200)
  view.backgroundColor = UIColor.lightGrayColor()
  
  let label = UILabel() // I can only see the label if I set a frame
           // UILabel(frame: CGRectMake(0, 0, 200, 50))
  label.backgroundColor = UIColor.greenColor()
  label.text = "I am a label"
  label.setTranslatesAutoresizingMaskIntoConstraints(false)
  view.addSubview(label)
  
  let views = ["label":label]
  let options = NSLayoutFormatOptions(0)
  
  let cs1 = NSLayoutConstraint.constraintsWithVisualFormat(
      "H:|-[label]-|", options: options, metrics: nil, views:views )
  
  let cs2 = NSLayoutConstraint.constraintsWithVisualFormat(
      "V:|-[label]-|", options: options, metrics: nil, views:views )
  
  view.addConstraints(cs1)
  view.addConstraints(cs2)
  </code></pre>
  
  <p>Thanks in advance</p>