标签:blog class alert now() index main nil alertview dismiss
/** *显示弹出信息 */ class func showAlertMessage(_ str:String,showtime Num:Double){ let alert = UIAlertView(title: str, message: nil, delegate: nil, cancelButtonTitle: nil); alert.show() // self.performSelector(#selector(dismissAlert(_:)), withObject: alert, afterDelay: Num) let dispatchTime: DispatchTime = DispatchTime.now() + Double(Int64(0.10 * Num * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC) DispatchQueue.main.asyncAfter(deadline: dispatchTime, execute: { dismissAlert(alert) }) } class func dismissAlert(_ alert:UIAlertView){ alert.dismiss(withClickedButtonIndex: alert.cancelButtonIndex, animated: true) }
IOS(Swift)使用系统UIAlertView方法做吐司效果
标签:blog class alert now() index main nil alertview dismiss
原文地址:http://www.cnblogs.com/mapanguan/p/UIAlertView.html