Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/93.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios Swift警报自定义显示和分发_Ios_Swift_Uialertview_Uialertcontroller - Fatal编程技术网

Ios Swift警报自定义显示和分发

Ios Swift警报自定义显示和分发,ios,swift,uialertview,uialertcontroller,Ios,Swift,Uialertview,Uialertcontroller,我在viewcontroller中创建了一个自定义警报,遵循该问题投票率最高的答案的指导原则: 我用它来显示警报,它被用作“加载” 显示: self.presentViewController(self.pending, animated: true, completion: nil) 我成功地显示了它,但我需要在进程结束后通过调用它的viewcontroller终止它,而不是像我引用的示例中那样自行终止它。 我试过了,但什么也没发生 self.pending.dismissViewCont

我在viewcontroller中创建了一个自定义警报,遵循该问题投票率最高的答案的指导原则:

我用它来显示警报,它被用作“加载”

显示:

self.presentViewController(self.pending, animated: true, completion: nil)
我成功地显示了它,但我需要在进程结束后通过调用它的viewcontroller终止它,而不是像我引用的示例中那样自行终止它。 我试过了,但什么也没发生

self.pending.dismissViewControllerAnimated(false, completion: { (vetor) -> Void in
                    […]
                })

如何正确执行此操作?

在演示
UIViewController
上调用
discover
,而不是在演示的控制器上:

self.dismiss(animated: true) {
    // go on
}

在显示的
UIViewController
上调用
discouse
,而不是在显示的控制器上调用:

self.dismiss(animated: true) {
    // go on
}