Skip to content

Instantly share code, notes, and snippets.

@tamaki-shingo
Created November 19, 2017 10:03
Show Gist options
  • Save tamaki-shingo/b896cd2180f96db5628d1f56f2cdb0df to your computer and use it in GitHub Desktop.
Save tamaki-shingo/b896cd2180f96db5628d1f56f2cdb0df to your computer and use it in GitHub Desktop.
Array extension for to Control layout constraints together
extension Array where Element == NSLayoutConstraint {
func activate() {
self.forEach { (constraint) in
constraint.isActive = true
}
}
func deactivate() {
self.forEach { (constraint) in
constraint.isActive = false
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment