Swift 基本控件UIAlertView学习
2016-02-23 10:46
483 查看
let alertView = UIAlertView() alertView.title = "系统提示" alertView.message = "您确定要离开hangge.com吗?" alertView.addButtonWithTitle("取消") alertView.addButtonWithTitle("确定") alertView.cancelButtonIndex=0 alertView.delegate=self; alertView.show() func alertView(alertView:UIAlertView, clickedButtonAtIndex buttonIndex: Int){ if(buttonIndex==alertView.cancelButtonIndex){ print("点击了取消") } else { print("点击了确认") } }
相关文章推荐
- swift-基本操作01-赋值取余运算符
- Swift 基本控件UISlider学习
- Swift-函数
- swift 中的delegate 写法
- Swift-字典
- Swift-数组
- SWIFT UITableView的基本用法
- Swift学习-字符串
- Swift学习-循环
- SWIFT Button的基本用法
- The Swift Programming Language学习笔记(十一)——属性
- The Swift Programming Language学习笔记(十)——类和结构体
- The Swift Programming Language学习笔记(九)——枚举
- The Swift Programming Language学习笔记(八)——闭包
- Swift UI学习之UITableView and protocol use
- Swift基础语法(一)
- Swift - 访问控制(private,internal,public)
- Swift学习-逻辑分支
- Swift UI学习之基础:UIButton,UILabel and UISlider
- Swift UIWebView的使用