【发布时间】:2015-07-21 13:41:04
【问题描述】:
我正在尝试将 Ok 按钮添加到 UI 警报,但我无法使用 alertController.addAction 添加它
在这种情况下我该怎么办?
提前致谢!!
if error == nil {
let alert: UIAlertController = UIAlertController(title: "Account Created", message: "Please confirm your email", preferredStyle: .Alert)
let okButton = UIAlertAction(title: "Ok", style: .Default) { action -> Void in
self.performSegueWithIdentifier("toMain", sender: self)
alertController.addAction(okButton)
self.presentViewController(alert, animated: true, completion: nil)
}
} else {
println("\(error)")
}
【问题讨论】:
-
它的 alert.addaction..not alertcontroller
标签: swift alert uialertcontroller uialertaction