Swift 动态创建提示框

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

}

上一篇:【朝花夕拾】Android自定义View篇之(十一)View的滑动,弹性滑动与自定义PagerView


下一篇:TODO:关于自媒体博客改名