UIAlertController在Swift中的用法
2016-07-03 00:02
483 查看
let alert:UIAlertController = UIAlertController(title: "message" ,message: "Thank you clicking",preferredStyle: UIAlertControllerStyle.Alert) alert.addAction(UIAlertAction(title: "close AlertView",style: UIAlertActionStyle.Default,handler: nil)) alert.addAction(UIAlertAction(title: "change color",style: UIAlertActionStyle.Default,handler:{alertAction in UIView.animateWithDuration(2.5, animations: {self.headerView.backgroundColor = UIColor.brownColor()}, completion: {_ in print("animate close") }) })) self.presentViewController(alert,animated:true,completion:nil)
相关文章推荐
- Apple Swift学习教程
- 介绍 Fedora 上的 Swift
- iOS开发之路--微博“更多”页面
- Swift中实现点击、双击、捏、旋转、拖动、划动、长按手势的类和方法介绍
- Swift自定义iOS中的TabBarController并为其添加动画
- Swift编程中的泛型解析
- Swift中定义二维数组的方法及遍历方法示例
- 简单分析Swift语言的一些基本特征
- 使用 Swift 语言编写 Android 应用入门
- Swift与C语言指针结合使用实例
- Swift心得笔记之控制流
- 用Swift构建一个简单的iOS邮件应用的方法
- 苹果公司推出的新编程语言Swift简介和入门教程
- Swift实现iOS应用中短信验证码倒计时功能的实例分享
- iOS开发之路--微博骨架搭建
- iOS开发使用JSON解析网络数据
- IOS开发代码分享之获取启动画面图片的string
- 使用Swift代码实现iOS手势解锁、指纹解锁实例详解
- iOS开发实现音频播放功能