
let alert = UIAlertController(Title: Title,message: message,preferredStyle: UIAlertControllerStyle.Alert) alert.addAction(UIAlertAction(Title: "Close VIEw",style: UIAlertActionStyle.Destructive,handler: { action in self.dismissVIEwControllerAnimated(true,completion: nil) })) alert.addAction(UIAlertAction(Title: "CANCEL",style: UIAlertActionStyle.Cancel,handler: nil)) self.presentVIEwController(alert,animated: true,completion: nil) 它没有任何影响.执行“关闭视图”处理程序后,显示警报的视图控制器仍然存在.
我还在UIAlertAction *** 作块中尝试了self.navigationController?.dismissVIEwControllerAnimated(true,completion:nil),但这也无效.
运用self.navigationController?.popVIEwControllerAnimated(true)
代替
self.dismissVIEwControllerAnimated(true,completion: nil)
根据需要工作并关闭显示警报的视图控制器.
总结以上是内存溢出为你收集整理的swift – 如何从UIAlertController的UIAlertAction处理程序中解除UIViewController?全部内容,希望文章能够帮你解决swift – 如何从UIAlertController的UIAlertAction处理程序中解除UIViewController?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)