我正在尝试将 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)")
}