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)
}
Swift3 使用系统UIAlertView方法做吐司效果的更多相关文章
- UIView封装动画--iOS 利用系统提供方法来做弹性运动
iOS 利用系统提供方法来做弹性运动 /*创建弹性动画 damping:阻尼,范围0-1,阻尼越接近于0,弹性效果越明显 velocity:弹性复位的速度 */ [UIView animateWith ...
- UIView封装动画--iOS利用系统提供方法来做转场动画
UIView封装动画--iOS利用系统提供方法来做转场动画 UIViewAnimationOptions option; if (isNext) { option=UIViewAnimationOpt ...
- UIView封装动画--iOS利用系统提供方法来做关键帧动画
iOS利用系统提供方法来做关键帧动画 ios7以后才有用. /*关键帧动画 options:UIViewKeyframeAnimationOptions类型 */ [UIView animateKey ...
- Method Swizzle黑魔法,修改 ios 系统类库方法 SEL IMP
Method Swizzle黑魔法,修改 ios 系统类库方法 版权声明:本文为博主原创文章,未经博主允许不得转载. 一般来说,系统提供的方法已经足够开发了,但是有的时候有些需求用普通方法不好做. ...
- buntu下备份系统的方法
今天不小心强行结束了一不知道用处的进程,结果造成进不了x界面,gdm启动不了,使用apt-get进行修复,结果几乎要把整个x界面有关的软件包删除,所以只好重装系统,为了防止下次出现类似的问题,所以把系 ...
- Android获取系统时间方法的总结
Android获取系统时间方法的方法有很多种,常用的有Calendar.Date.currentTimeMills等方法. (1)Calendar Calendar获取系统时间首先要用Calendar ...
- 重新格式化hdfs系统的方法
重新格式化hdfs系统的方法: (1)查看hdfs-ste.xml <span style="font-size:18px;"><property> < ...
- tar备份系统的方法
下面是备份系统的方法: 然后打开终端,输入以下命令: 1.成为根用户: sudo su 2.转到根目录: cd / 然後,下面就是我用来备份我的系统的完整的命令:tar -cvpzf /med ...
- 下载文件 ,调用系统的方法(UIDocumentInteractionController) 查看
随机推荐
- 01. pt-align
01. pt-align pt-align xxx.txt =========================================== pt-align对齐输出格式 name city a ...
- 不解压查看tar.gz包内文件
通过tar命令备份.解压缩文件,也可在不解压缩文件时查看包内的文件信息. 使用如下参数: tar -ztvf file.tar.gz 将列出所有包内的文件列表,包括目录 -z, --gzip, --g ...
- JSON数据映射之元素可见控制
1.效果: 2.demo 源码 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"&g ...
- fastcgi vc6.0demo
#include <WinSock2.h> #include <stdio.h> #pragma comment(lib, "ws2_32.lib") ty ...
- oracle迁移
#导出scott的数据,排除 table_a table_b expdp system/password schemas=scott directory=datadir dumpfile=scott_ ...
- left join用法
表1: Person +-------------+---------+ | 列名 | 类型 | +-------------+---------+ | PersonId | int | | Firs ...
- Python如何利用Xpath进行解析
用Python做网络爬虫的时候,会对网页的信息进行提取,笔者接触的有正则表达式,BeautifulSoup,Xpath,前面两个都是在国内能够使用的,而Xpath是Chrome的一个插件,因此需要“F ...
- 【转】Centos7下Yum安装PHP5.5,5.6,7.0
默认的版本太低了,手动安装有一些麻烦,想采用Yum安装的可以使用下面的方案: 1.检查当前安装的PHP包 yum list installed | grep php 如果有安装的PHP包,先删除他们 ...
- Oracle导入的常见语句
登录sql > sqlplus / as sysdba 创建表空间sql > create tablespace TABLESPACE datafile 'e:\tables1.dbf' ...
- ThinkPHP redirect 传参
重定向带参 $this->redirect('pay/under_line_success',array('order_id'=>$stuInfo),5,'页面跳转中….'); 第一个参数 ...