Created
October 20, 2022 14:34
-
-
Save xmhafiz/30e43c50b48f5043b0392ce9c5f65456 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// | |
// ResultViewController.swift | |
// | |
import UIKit | |
class ResultViewController: UIViewController { | |
lazy var messageLabel: UILabel = { | |
let label = UILabel() | |
label.text = "Login success" | |
label.translatesAutoresizingMaskIntoConstraints = false | |
return label | |
}() | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
view.backgroundColor = .white | |
setupConstraints() | |
} | |
func setupConstraints() { | |
view.addSubview(messageLabel) | |
NSLayoutConstraint.activate([ | |
messageLabel.centerYAnchor.constraint(equalTo: view.centerYAnchor), | |
messageLabel.centerXAnchor.constraint(equalTo: view.centerXAnchor) | |
]) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment