I'm trying to get a textField value from UIAlertController, but whenever I try to enter the value and try to print it out, the output doesn't show anything.
code:
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