Created
January 6, 2019 20:18
-
-
Save pedrommcarrasco/be50ad4da9a743c791ee07fbd39ee970 to your computer and use it in GitHub Desktop.
Power-Up Your Anchors - Adding Subviews
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 UIView { | |
func addSubviewsUsingAutoLayout(_ views: UIView ...) { | |
views.forEach { | |
self.addSubview($0) | |
$0.translatesAutoresizingMaskIntoConstraints = false | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment