swift [Swift]在当前弹出窗口中显示警报(SimpleTransitioningDelegate)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了swift [Swift]在当前弹出窗口中显示警报(SimpleTransitioningDelegate)相关的知识,希望对你有一定的参考价值。

 let alert = UIAlertController(title: "Thông báo", message: "Vui lòng chọn một cửa hàng", preferredStyle: UIAlertControllerStyle.alert)
            alert.addAction(UIAlertAction(title: "Đồng ý", style: .cancel, handler: nil))
            // assuming that this is the first time your controller is presented
            present(alert, animated: true, completion: nil)
            //something bad happened and your application is trying to present the alert again, safe guard against presenting it twice by checking if presentedViewController is nil or not
            if presentedViewController == nil {
                present(alert, animated: true, completion: nil)
            }

以上是关于swift [Swift]在当前弹出窗口中显示警报(SimpleTransitioningDelegate)的主要内容,如果未能解决你的问题,请参考以下文章