Last active
December 28, 2016 20:34
-
-
Save wh1pch81n/f48fc764e556dee3f99362f16fd957bb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Adding a vertical constraint between view1 and view2 using default padding | |
// DHConstraintBuilder | |
parentView.addConstraints(view1 ^-^ view2).V | |
// NSLayoutConstraints | |
parentView.translatesAutoresizingMaskIntoConstraints = false | |
parentView.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:[view1]-[view2]" | |
, options: NSLayoutFormatOptions(rawValue: 0) | |
, metrics: nil, views: ["view1": view1, "view2": view2])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment