更新时间:2022-02-06 07:17:03
您应使用 UIAlertController
UIAlertView
已过时。
您可以使用以下代码显示警报:
You can show an alert with this code:
var alert = UIAlertController(title: "Alert", message: "test", preferredStyle: UIAlertControllerStyle.Alert)
alert.addAction(UIAlertAction(title: "Click", style: UIAlertActionStyle.Default, handler: nil))
self.presentViewController(alert, animated: true, completion: nil)