我有一个UIAlertController,当用户在TouchID屏幕上 Select "输入密码"时,它会提示用户.在屏幕上显示后,如何恢复用户的输入?
let passwordPrompt = UIAlertController(title: "Enter Password", message: "You have selected to enter your passwod.", preferredStyle: UIAlertControllerStyle.Alert)
passwordPrompt.addAction(UIAlertAction(title: "Cancel", style: UIAlertActionStyle.Default, handler: nil))
passwordPrompt.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil))
passwordPrompt.addTextFieldWithConfigurationHandler({(textField: UITextField!) in
textField.placeholder = "Password"
textField.secureTextEntry = true
})
presentViewController(passwordPrompt, animated: true, completion: nil)
我知道OK按钮应该有一个处理程序,但现在这段代码实际上什么都不做,但我想通过println显示文本字段的输出.这真的只是一个测试应用程序,让我学习Swift和一些新的API知识.