Created
November 19, 2017 10:03
-
-
Save tamaki-shingo/b896cd2180f96db5628d1f56f2cdb0df to your computer and use it in GitHub Desktop.
Array extension for to Control layout constraints together
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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