Skip to content

Instantly share code, notes, and snippets.

@sTinGe

sTinGe/constraints.swift

Last active Dec 20, 2019
Embed
What would you like to do?
// UIViewController
let constraints = [
view.centerXAnchor.constraint(equalTo: superview.centerXAnchor),
view.centerYAnchor.constraint(equalTo: superview.centerYAnchor),
view.widthAnchor.constraint(equalTo: superview.widthAnchor)
view.heightAnchor.constraint(equalTo: superview.heightAnchor),
]
NSLayoutConstraint.activate(constraints)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.