Swift弹窗

在一个ViewController中使用以下代码:

let alertController = UIAlertController(title: "Game Set", message: "You got 100", preferredStyle: .Alert)
alertController.addAction(UIAlertAction(title: "Confirm", style: .Default, handler: nil))
self.presentViewController(alertController, animated: true, completion: nil)

效果如图:

原文地址:https://www.cnblogs.com/cecilma/p/swift_alertview.html