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)的主要内容,如果未能解决你的问题,请参考以下文章

关闭一个自定义弹出窗口UIViewController并立即显示另一个自定义弹出窗口UIViewController -SWIFT

如何在 swift ui 中显示两个警报,一个接着一个

在 Swift 中创建自定义 UIView 并显示为弹出窗口

Swift 中显示 UIAlertcontroller 时保持键盘打开?

swift 2.2中api(json)没有数据时如何显示警报

在屏幕上居中 Swift 弹出窗口