Skip to content

Instantly share code, notes, and snippets.

@DoubleREW
Created February 24, 2015 18:15
Show Gist options
  • Save DoubleREW/fdec70b86cf9011d0ca6 to your computer and use it in GitHub Desktop.
Save DoubleREW/fdec70b86cf9011d0ca6 to your computer and use it in GitHub Desktop.
self.tabBar.snp_makeConstraints { (make) -> () in
make.width.equalTo(68.0)
make.top.equalTo(s.snp_top)
make.bottom.equalTo(s.snp_bottom)
make.leading.equalTo(s.snp_leading)
}
self.tabView.snp_makeConstraints { (make) -> () in
make.top.equalTo(s.snp_top)
make.bottom.equalTo(s.snp_bottom)
make.trailing.equalTo(s.snp_trailing)
make.leading.equalTo(self.tabBar.snp_trailing)
}
/*
self.tabBar.addConstraints([
NSLayoutConstraint(
item: self.tabBar,
attribute: NSLayoutAttribute.Width,
relatedBy: NSLayoutRelation.Equal,
toItem: nil,
attribute: NSLayoutAttribute.NotAnAttribute,
multiplier: 1.0,
constant: 68),
])
s.addConstraints([
// TabView
NSLayoutConstraint(
item: self.tabView,
attribute: NSLayoutAttribute.Leading,
relatedBy: NSLayoutRelation.Equal,
toItem: self.tabBar,
attribute: NSLayoutAttribute.Trailing,
multiplier: 1.0,
constant: 0),
NSLayoutConstraint(
item: self.tabView,
attribute: NSLayoutAttribute.Trailing,
relatedBy: NSLayoutRelation.Equal,
toItem: s,
attribute: NSLayoutAttribute.Trailing,
multiplier: 1.0,
constant: 0),
NSLayoutConstraint(
item: self.tabView,
attribute: NSLayoutAttribute.Top,
relatedBy: NSLayoutRelation.Equal,
toItem: s,
attribute: NSLayoutAttribute.Top,
multiplier: 1.0,
constant: 0),
NSLayoutConstraint(
item: self.tabView,
attribute: NSLayoutAttribute.Bottom,
relatedBy: NSLayoutRelation.Equal,
toItem: s,
attribute: NSLayoutAttribute.Bottom,
multiplier: 1.0,
constant: 0),
// TabBar
NSLayoutConstraint(
item: self.tabBar,
attribute: NSLayoutAttribute.Top,
relatedBy: NSLayoutRelation.Equal,
toItem: s,
attribute: NSLayoutAttribute.Top,
multiplier: 1.0,
constant: 0),
NSLayoutConstraint(
item: self.tabBar,
attribute: NSLayoutAttribute.Bottom,
relatedBy: NSLayoutRelation.Equal,
toItem: s,
attribute: NSLayoutAttribute.Bottom,
multiplier: 1.0,
constant: 0),
NSLayoutConstraint(
item: self.tabBar,
attribute: NSLayoutAttribute.Left,
relatedBy: NSLayoutRelation.Equal,
toItem: s,
attribute: NSLayoutAttribute.Left,
multiplier: 1.0,
constant: 0)
])
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment