extension UIViewController {
func alert(_ message: String, completion: (()->Void)? = nil) {
DispatchQueue.main.async {
let alert = UIAlertController(title: nil, message: message, preferredStyle: .alert)
let okAction = UIAlertAction(title: "νμΈ", style: .cancel) { (_) in
completion?()
}
alert.addAction(okAction)
self.present(alert, animated: false)
}
}
}
μ¬μ©ν λμλ μ무λ°μλ
self.alert("μλ¦Όλ©μμ§!!!")
μ΄λ κ² μ¬μ©νλ©΄ λλ€ π
λ°μν