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
}
时间: 2024-11-01 21:21:59