我正在尝试制作一个警报控制器,如果答案是"确定",那么它将执行一个到MapView的segue.这是完整的代码:
@IBAction func teste(_ sender: Any) {
// Create the alert controller
let alertController = UIAlertController(title: "Reservar vaga?", message: "Uma vaga será reservada em Estapar Estacionamento.", preferredStyle: .alert)
// Create the actions
let okAction = UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: {(alert:UIAlertAction) -> Void in
let confirmAction = UIAlertController(title: "Vaga confirmada", message: "Gostaria de ter direções ao local?", preferredStyle: .alert)
let okConfirmAction = UIAlertAction(title:"Sim", style: UIAlertActionStyle.default, handler:{(alert:UIAlertAction) -> Void in
presentViewController(ViewController, animated: true, completion: nil)
})
let noConfirmAction = UIAlertAction(title:"Não", style: …Run Code Online (Sandbox Code Playgroud)