码迷,mamicode.com
首页 > 编程语言 > 详细

Swift 动态创建提示框

时间:2015-01-23 00:35:52      阅读:425      评论:0      收藏:0      [点我收藏+]

标签:

var alert = UIAlertController(title: "", message: "", prefferedStyle: UIAlertControllerStyle.Alert)

 

//添加按钮

let oneAction = UIAlertAction(title: "", style: UIAlertActionStyle.Default) {(action: UIAlertAction)->Void in

//取文本框内容

 let textField = alert.textField[0] as TextField 

}

alert.addAction(oneAction )

 

//添加文本框

alert.addTextFieldWithConfigurationHandle{(textField: UITextField)->Void in

}

 

//显示弹出框

self.presentViewController(alert, animated: true){()->Void in

}

Swift 动态创建提示框

标签:

原文地址:http://www.cnblogs.com/SimonGao/p/4243004.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!