Adding a simple UIAlertView

后端 未结 10 660
囚心锁ツ
囚心锁ツ 2020-12-12 14:26

What is some starter code I could use to make a simple UIAlertView with one \"OK\" button on it?

10条回答
  •  渐次进展
    2020-12-12 15:30

    For Swift 3:

    let alert = UIAlertController(title: "Alert", message: "Message", preferredStyle: UIAlertControllerStyle.alert)
    alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: nil))
    self.present(alert, animated: true, completion: nil)
    

提交回复
热议问题