Skip to content

Instantly share code, notes, and snippets.

@pedrommcarrasco
Created January 6, 2019 20:18
Show Gist options
  • Save pedrommcarrasco/be50ad4da9a743c791ee07fbd39ee970 to your computer and use it in GitHub Desktop.
Save pedrommcarrasco/be50ad4da9a743c791ee07fbd39ee970 to your computer and use it in GitHub Desktop.
Power-Up Your Anchors - Adding Subviews
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