Skip to content

Instantly share code, notes, and snippets.

@smileyborg
Last active August 29, 2015 14:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smileyborg/96ca0e46b0fe1ae5161b to your computer and use it in GitHub Desktop.
Save smileyborg/96ca0e46b0fe1ae5161b to your computer and use it in GitHub Desktop.
PureLayout in Swift
func setupConstraints()
{
let views: NSArray = [view1, view2, view3]
views.autoDistributeViewsAlongAxis(.Horizontal, withFixedSpacing: 10.0, insetSpacing: true, matchedSizes: false, alignment: .AlignAllTop)
// if you don't like creating an intermediate constant, the following works using Xcode 6.1 GM:
[view1, view2, view3].autoDistributeViewsAlongAxis(.Horizontal, withFixedSpacing: 10.0, insetSpacing: true, matchedSizes: false, alignment: .AlignAllTop)
}
@danielgomezrico
Copy link

What bridging header did you use?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment