Skip to content

Instantly share code, notes, and snippets.

@xmhafiz
Created October 20, 2022 14:34
Show Gist options
  • Save xmhafiz/30e43c50b48f5043b0392ce9c5f65456 to your computer and use it in GitHub Desktop.
Save xmhafiz/30e43c50b48f5043b0392ce9c5f65456 to your computer and use it in GitHub Desktop.
//
// 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