zoukankan      html  css  js  c++  java
  • Swift3 使用系统UIAlertView方法做吐司效果

        

       /**
         *显示弹出信息
         */
        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)
        }
    

      

  • 相关阅读:
    使用mongoose--写接口
    数据结构上机实验(2)
    时间复杂度十道练习题目
    Python网络爬虫实战入门
    区分矩阵的三大关系
    用python检查矩阵的计算
    ab矩阵(实对称矩阵)
    Python大数据应用
    数据结构上机实验(1)
    0038. Count and Say (E)
  • 原文地址:https://www.cnblogs.com/mapanguan/p/UIAlertView.html
Copyright © 2011-2022 走看看