Last active
July 10, 2021 03:53
-
-
Save froggomad/a594fe39f153a40fd75fc33a3a31f5c9 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, target: self, selector: #selector(presentAlert)) | |
return view | |
}() | |
override func loadView() { | |
view = blueView | |
} | |
@objc private func presentAlert() { | |
let alertController = UIAlertController(title: "Hello", message: "World", 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