swift 弹窗

直接拷贝使用即可

let alert = UIAlertController(title:nil,message:"输入不能为空",preferredStyle: .Alert)

let okAction = UIAlertAction(title: "OK", style: .Default, handler: nil)
            
alert.addAction(okAction)

self.presentViewController(alert, animated: true, completion: nil)

"输入不能为空"  可以替换为字符变量

原文地址:https://www.cnblogs.com/qiyiyifan/p/5995605.html