I've created a UIAlertController with a text field and an action to send a verification code to the user's phone number. However, the action dismisses the alert controller as well, making the user unable to enter the verification code. Is there a way to make an alert action not dismiss the alert controller?
let alertController = UIAlertController(title: "Verification", message: "a code has been sent to your phone number", preferredStyle: .alert)
let confirm = UIAlertAction(title: "Confirm", style: .default, handler: {
alert -> Void in
//verifies code
})
let resend = UIAlertAction(title: "Resend", style: .default, handler: {
alert -> Void in
//resends code
})
let cancelAction = UIAlertAction(title: "Cancel", style: .default, handler: {
(action : UIAlertAction!) -> Void in
})
alertController.addTextField { (textField : UITextField!) -> Void in
textField.placeholder = "Enter code"
}
alertController.addAction(confirm)
alertController.addAction(resend)
alertController.addAction(cancelAction)
self.present(alertController, animated: true, completion: nil)