У меня есть этот код, но я не знаю, как показать текстовое поле внутри UIAlertView.
var altMessage = UIAlertController(title: "Warning", message: "This is Alert Message", preferredStyle: UIAlertControllerStyle.Alert)
altMessage.addAction(UIAlertAction(title: "Done", style: UIAlertActionStyle.Default, handler: nil))
self.presentViewController(altMessage, animated: true, completion: nil)
У меня есть этот код для текстового поля, как я могу показать это в UIAlerView
var my:UITextField = UITextField(frame: CGRectMake(0, 0, 10, 10))
Я также пробовал этот код:
var alert = UIAlertView()
alert.title = "Enter Input"
alert.addButtonWithTitle("Done")
alert.alertViewStyle = UIAlertViewStyle.PlainTextInput
alert.addButtonWithTitle("Cancel")
alert.show()
Когда я укажу AlertStyle plainText, он отобразит TextField с записями по умолчанию, "Вход". Я хочу изменить это, я хочу показать Клавиатуру Decimal Pad. Я также хочу обработать значение, которое пользователь вводит в textField. Может кто-нибудь помочь мне с этим?