Q:

Prompting user to enter input through UIAlertController again after validation fails gives a WARNING on logs

I am using the following function to prompt user for email address. 
The validateEmailAddress and validateVerificationCodeAgainstEmail call the function below, promptUserToEnterEmail, again if validation fails. The problem is that I get the Warning message shown below when the user is prompted again.
func promptUserToEnterEmail() {

            var alertController:UIAlertController?
            alertController = UIAlertController(title: "Enter Email Address",
            message: "Please enter your email address.",
            preferredStyle: .Alert)

            alertController!.addTextFieldWithConfigurationHandler(
                {(textField: UITextField!) in
                textField.placeholder = "Email"
            })

            let action = UIAlertAction(title: "Submit",
                style: UIAlertActionStyle.Default,
                handler: {[weak self]
                (paramAction:UIAlertAction!) in
                if let textFields = alertController?.textFields{
                    let theTextFields = textFields as [UITextField]
                    let enteredText:UITextField = theTextFields[0]
                    print("prompted email: \(enteredText.text)")
                    // Validate email address
                    self!.validateEmailAddress(enteredText)
                    print("Returned from validateEmailAddress()");
                    // Continue to validate verification code against email address
                    self!.validateVerificationCodeAgainstEmail()
                    print("Returned from validateVerificationCodeAgainstEmail()");
                }
            })

            alertController?.addAction(action)

            let cancelItem = UIAlertAction(title: "Cancel", style: .Cancel, handler: nil)
                alertController?.addAction(cancelItem)

            self.presentViewController(alertController!,
                animated: true,
                completion: nil)

    }

WARNING MESSAGE:
    Warning: Attempt to present <UIAlertController: 0x7fe6f0eb4bb0> 
on <XXXXXV1.ViewController: 0x7fe6f0cd7400> which is already presenting 
<UIAlertController: 0x7fe6f0e3ea50>

A:

Well if you are so hellbent on showing two alerts one after another then you can delay the second alert by a certain amount of time after the first one is displayed:
let delay = 10.0 * Double(NSEC_PER_SEC);
let time = dispatch_time(DISPATCH_TIME_NOW, Int64(delay));
dispatch_after(time, dispatch_get_main_queue(), {
            //display the second alert here
        })

Or you could dismiss the alert controller after the submit gives an error.
So you can display the first alert and after the submit button is pressed call the dismiss the firstAlert:
firstAlert.dismissViewControllerAnimated(true, completion: nil)

Once that is done, simply follow your current flow

