UIAlertView is Not Working in Swift

后端 未结 4 1751
执笔经年
执笔经年 2020-12-10 00:09

when i runt this code in swift, i dont know why the app terminates by showing a break point in the \"alertView.show()\" part, Somebody please help me.

var al         


        
4条回答
  •  我在风中等你
    2020-12-10 00:40

    the best way for me is...

    class ViewController: UIViewController, UIAlertViewDelegate {
    var allarme = UIAlertView(title: "Warning", message: "This is a best way to create a alarm message", delegate: self, cancelButtonTitle: "OK")
            allarme.show()
    

    remember to import on the class UIAlertViewDelegate

提交回复
热议问题