【发布时间】:2015-05-20 08:58:49
【问题描述】:
我正在尝试从 UIAlertController 获取 textField 值,但每当我尝试输入该值并尝试将其打印出来时,输出都不会显示任何内容。
代码:
var alert = UIAlertController(title: "Enter the password", message: "Message", preferredStyle: UIAlertControllerStyle.Alert)
alert.addAction(UIAlertAction(title: "Click", style: UIAlertActionStyle.Default, handler: nil))
alert.addTextFieldWithConfigurationHandler({(textField: UITextField!) in
textField.placeholder = "Enter text:"
textField.secureTextEntry = true
println(textField.text)
})
self.presentViewController(alert, animated: true, completion: nil
【问题讨论】:
标签: ios swift uialertcontroller