Error showing a UIAlertView in swift

前端 未结 7 2035
独厮守ぢ
独厮守ぢ 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:03

    Even though UIAlertView is depreciated in iOS8, you can get away with using it but not through it's init function. For example:

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

    Atleast this is the only way so far I've been able to successfully use an UIAlertView. I'm unsure on how safe this is though.

提交回复
热议问题