title: Why is my layout constraint returning an error in this case? (Swift)
body: <p>I am trying to peg a label (progressTimer label) 10 units to the left of my slider (sliderDemo). I am using the following constraint but for some reason my application keeps on crashing. I can't seem to find anything wrong with it. Any help would be greatly appreciated!</p>
  
  <pre><code>var constS1 = NSLayoutConstraint(item: progressTimerLabel, attribute: NSLayoutAttribute.Left, relatedBy: NSLayoutRelation.Equal, toItem: sliderDemo, attribute: NSLayoutAttribute.Left, multiplier: 1, constant: 10)
  progressTimerLabel.addConstraint(constS1)
  </code></pre>
  
  <p>Here is part of the error log </p>
  
  <pre><code>The view hierarchy is not prepared for the constraint: &lt;NSLayoutConstraint:0x79edb790 UILabel:0x79e74dd0'0:00'.right == UISlider:0x79e744f0.left + 10&gt;
  </code></pre>