-
-
Save sturdysturge/fc44af97b823663a23b19ea4cf81fbc2 to your computer and use it in GitHub Desktop.
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
import UIKit | |
class ViewController: UIViewController { | |
var labelText = UILabel(frame: .zero) | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
view.addSubview(labelText) | |
labelText.translatesAutoresizingMaskIntoConstraints = false | |
NSLayoutConstraint.activate([ | |
labelText.centerYAnchor.constraint(equalTo: view.centerYAnchor), | |
labelText.centerXAnchor.constraint(equalTo: view.centerXAnchor) | |
]) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment