Error showing a UIAlertView in swift

前端 未结 7 2030
独厮守ぢ
独厮守ぢ 2021-02-20 06:11

Im trying to show a UIAlertView in my swift App

    alert = UIAlertView(title: \"\",
        message: \"bla\",
        delegate: self,
        cancelButtonTitle:         


        
7条回答
  •  北恋
    北恋 (楼主)
    2021-02-20 07:04

    I was successfully able to show a UIAlertView using this code:

    var alert = UIAlertView()
    alert.title = "Title"
    alert.message = "Message"
    alert.addButtonWithTitle("Understood")
    alert.show()
    

    The code "alert.addButtonWithTitle("Understood")" adds a button for the user to push after they have read the error message.

    Hope this helps you.

提交回复
热议问题