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)
        }
    

      

  • 相关阅读:
    [noip2013]华容道
    [tyvj 1061] Mobile Service (线性dp 滚动数组)
    [bzoj 2726] 任务安排 (斜率优化 线性dp)
    [洛谷 P2365] 任务安排 (线性dp)
    [poj 3666] Making the Grade (离散化 线性dp)
    【模板】manacher算法
    [tyvj 1071] LCIS
    [NOIP 2012] 国王游戏
    [NOIP 2010] 关押罪犯 (二分+二分图判定 || 并查集)
    [NOI 2002] 银河英雄传说 (带权并查集)
  • 原文地址:https://www.cnblogs.com/mapanguan/p/UIAlertView.html
Copyright © 2011-2022 走看看