Auto Layout Programmatically with Scroll View Error
<p>I am trying to have add a view inside a paging-scrollView inside of a ViewController, and I am having a lot of Auto Layout problems (all of this code is programatic, non-Storyboard).</p>

<p>The first set of constraints work properly, but the second set (<code>sv</code> and <code>firstView</code>) cause the following error: <code>libc++abi.dylib: terminating with uncaught exception of type NSException</code></p>

<p>Any help on this issue would be greatly appreciated, code below:</p>

<pre><code>override func viewDidLoad() {
    super.viewDidLoad()

    view.backgroundColor = .whiteColor()

    sv.backgroundColor = .redColor()
    view.addSubview(sv)

    sv.translatesAutoresizingMaskIntoConstraints = false
    view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|[sv]|", options: .DirectionLeadingToTrailing, metrics: nil, views: ["sv": sv]))
    view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|[sv]|", options: .DirectionLeadingToTrailing, metrics: nil, views: ["sv": sv]))
    sv.pagingEnabled = true

    let firstView = UIView()
    firstView.backgroundColor = .greenColor()
    sv.addSubview(firstView)
    firstView.translatesAutoresizingMaskIntoConstraints = false
    sv.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|[f]|", options: .DirectionLeadingToTrailing, metrics: nil, views: ["fv": firstView]))
    sv.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|[fv]|", options: .DirectionLeadingToTrailing, metrics: nil, views: ["fv": firstView]))
}
</code></pre>