小编Luc*_*eal的帖子

无法将"ViewController.Type"类型的值转换为预期的参数类型"UIViewController"

我正在尝试制作一个警报控制器,如果答案是"确定",那么它将执行一个到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)

ios swift

9
推荐指数
1
解决办法
2万
查看次数

标签 统计

ios ×1

swift ×1