반응형
//
// ViewController.swift
// JoonhoiOS
//
// Created by jysoft on 2023/03/29.
//
import UIKit
class ViewController: UIViewController {
//title
var titleLable : UILabel = {
let label = UILabel()
label.text = "Hellow world ! "
label.textAlignment = .center
label.font = UIFont.boldSystemFont(ofSize: 50)
label.textColor = .white
return label
}()
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
view.backgroundColor = .red
// 추가적으로 만든 뷰를 넣는다 . 빌드업
view.addSubview(titleLable)
// 화면 센터 위 아래
titleLable.translatesAutoresizingMaskIntoConstraints = false
titleLable.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
titleLable.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true
}
}
반응형