Error showing a UIAlertView in swift

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

    Xcode 10, Swift 4.2 version

            let alert = UIAlertController(title: "Title", message: "Message", preferredStyle: UIAlertController.Style.alert)
            alert.addAction(UIAlertAction(title: "Button", style: UIAlertAction.Style.default, handler: nil))
            self.present(alert, animated: true, completion: nil)
    

提交回复
热议问题