我使用这段代码有警报视图:关闭警告当按钮被按下斯威夫特
func alert() {
let alert = UIAlertController(title: "Time Is Up",
message: "Either your company has Sold or had to Fold! (Click the button below to see)",
preferredStyle: .alert)
let action = UIAlertAction(title: "Next", style: .default) { _ in
self.performSegue(withIdentifier: "congratsSegue", sender: nil)
}
alert.addAction(action)
self.present(alert, animated: true, completion: nil)
}
我想要再打开此警报关闭时完成按钮按下:
@IBAction func donePressed() {
}
这是可能的在Swift中做什么?
您还可以在UIAlert之一上添加2个动作按钮以进行下一个和一个取消。 –