Skip to content

Instantly share code, notes, and snippets.

@tristanoneil
Created August 15, 2014 14:43
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 tristanoneil/ce3e7c948f45c1843ee0 to your computer and use it in GitHub Desktop.
Save tristanoneil/ce3e7c948f45c1843ee0 to your computer and use it in GitHub Desktop.
self.navigationController.view.addConstraints([
NSLayoutConstraint(
item: add,
attribute: .Width,
relatedBy: .Equal,
toItem: add,
attribute: .Width,
multiplier: 1,
constant: 0
),
NSLayoutConstraint(
item: add,
attribute: .Height,
relatedBy: .Equal,
toItem: add,
attribute: .Height,
multiplier: 1,
constant: 0
),
NSLayoutConstraint(
item: add,
attribute: .Right,
relatedBy: .Equal,
toItem: navigationBar,
attribute: .Right,
multiplier: 1,
constant: 0
),
NSLayoutConstraint(
item: add,
attribute: .CenterY,
relatedBy: .Equal,
toItem: navigationBar,
attribute: .CenterY,
multiplier: 1,
constant: 0
)
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment