Skip to content

Instantly share code, notes, and snippets.

@abbood
Last active December 28, 2015 12:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abbood/7500976 to your computer and use it in GitHub Desktop.
Save abbood/7500976 to your computer and use it in GitHub Desktop.
this is an example of where I use many constraints all at once.. I like the visual format language b/c it provides a nice summary of things without being too verbose.. obviously addConstraintFormats is a method I created.. but that's besides the point
[self.overallContainerView addConstraintFormats:@[[NSString stringWithFormat:@"V:[overallContainer(>=%f)]",overallContainerHeight],
[NSString stringWithFormat:@"V:[iconsContainer]-%f-|",(imageSize.height+ kLargePadding*2)],
@"V:[selectedContainer(==35)]-0-|",
@"|-10-[selectedContainer(>=300)]",
@"V:[tagWrapper(==tagButton+10)]-35-|",
@"[tagWrapper(==tagButton+30))]",
]
withBindingDict:@{@"overallContainer":_overallContainerView,
@"iconsContainer":_iconsContainerView,
@"selectedContainer":selectedFoldersContainerView,
@"tagWrapper":tagWrapper,
@"tagButton":_tagButton}
isAnimated:YES];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment