NSLayoutFormatOptions - allZeros and

On Xcode7 beta, I am facing the following issues:


I am trying to create 2 constraints using visual format:


Constraint 1:

        let views1 = ["v1" : v1]

        let verticalConstraints1 = NSLayoutConstraint.constraintsWithVisualFormat("V:|-[v1]",
            options: .allZeros,
            metrics: nil,
            views: views1)


I get an error for .allZeros, What is the way to resolve this ?


Constraint 2:

        let views2 = ["v2" : v2]

        let verticalConstraints2 = NSLayoutConstraint.constraintsWithVisualFormat("V:|-[v2]",
            options: .AlignAllLeft | .AlignAllRight,
            metrics: nil,
            views: views2)


I get an error for .AlignAllLeft | .AlignAllRight, What is the way to resolve this ?

Replies

Read the changelog. These option sets are now sets and can be initialised using ArrayLiteral syntax.


Edit: Specifically, something like [] and [.AlignAllLeft, .AlignAllRight] should work, respectively. But I didn't check.