Skip to content

Instantly share code, notes, and snippets.

@denkeni
Created April 4, 2017 03:53
Show Gist options
  • Save denkeni/54a193bcac72b1f1df03c5e2107acd43 to your computer and use it in GitHub Desktop.
Save denkeni/54a193bcac72b1f1df03c5e2107acd43 to your computer and use it in GitHub Desktop.
Auto Layout Programmatically 2-1
let viewsDictB = ["subviewB": subviewB]
constraints += NSLayoutConstraint.constraints(withVisualFormat: "V:|-(150)-[subviewB]-(150)-|",
options: [], metrics: nil, views: viewsDictB)
// V: Vertical
constraints += NSLayoutConstraint.constraints(withVisualFormat: "H:|-(100)-[subviewB]-(100)-|",
options: [], metrics: nil, views: viewsDictB)
// H: Horizontal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment