Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class WelcomeViewController: UIViewController {
- private let signInButton: UIButton = {
- let button = UIButton()
- button.backgroundColor = .none
- button.layer.borderWidth = 2
- button.clipsToBounds = true
- button.setTitle("apple idでログイン".uppercased(), for: .normal)
- button.setTitleColor(.systemBackground, for: .normal)
- return button
- }()
- override func viewDidLoad() {
- super.viewDidLoad()
- title = "タイトル"
- view.backgroundColor = .systemGreen
- view.addSubview(signInButton)
- signInButton.addTarget(self, action: #selector(didTapSignIn), for: .touchUpInside)
- }
- override func viewDidLayoutSubviews() {
- super.viewDidLayoutSubviews()
- signInButton.frame = CGRect(x: 20, y: view.height - 50 - view.safeAreaInsets.bottom, width: view.width - 40, height: 50)
- signInButton.layer.cornerRadius = signInButton.frame.size.height / 2
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement