Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed init(H: VFLComponent, options: NSLayoutConstraint.FormatOptions = []) and init(V: VFLComponent, options: NSLayoutConstraint.FormatOptions = []) #17

Merged
merged 1 commit into from
Jun 14, 2020

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