Skip to content

Conversation

@RomanPodymov
Copy link
Contributor

Hello.
Thank you for Swiftstraints.
In this pull request I fixed the problem with the Array elements type create with init(H: VFLComponent, options: NSLayoutConstraint.FormatOptions = []) and init(V: VFLComponent, options: NSLayoutConstraint.FormatOptions = []). Currently the following test fails:

func testVFLComponent2() {
    class MyConstraint: NSLayoutConstraint {
            
    }
        
    let superview = UIView()
    let view1 = UIView()
    let view2 = UIView()
    superview.addSubview(view1)
    superview.addSubview(view2)

    _ = {
        let shorthandConstraints = [MyConstraint](H:|-[view1]-(>=5)-[view2]-3-|)
        let normalConstraints = NSLayoutConstraint.constraints(withVisualFormat: "H:|-[view1]-(>=5)-[view2]-3-|",
                                                               options: [],
                                                               metrics: nil,
                                                               views: ["view1" : view1, "view2" : view2])
        for (lh, rh) in zip(shorthandConstraints, normalConstraints) {
            XCTAssert(lh == rh)
        }
    }()
}

@bradhilton
Copy link
Member

Thank you @RomanPodymov !

@bradhilton bradhilton merged commit 333a44f into Skyvive:master Jun 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants