Created
July 10, 2021 03:29
-
-
Save froggomad/96d2ba5a199b49c7432704af9e95463c 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
import UIKit | |
class ViewController: UIViewController { | |
lazy var blueView: ViewControllerView = { | |
let view = ViewControllerView(viewColor: .systemBlue) | |
return view | |
}() | |
override func viewDidAppear(_ animated: Bool) { | |
super.viewDidAppear(animated) | |
presentAlert(title: "Hello", body: "World") | |
} | |
override func loadView() { | |
view = blueView | |
} | |
@objc private func presentAlert(title: String, body: String) { | |
let alertController = UIAlertController(title: title, message: body, preferredStyle: .alert) | |
let action = UIAlertAction(title: "Ok", style: .default) | |
alertController.addAction(action) | |
present(alertController, animated: true) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment