title: Swift 4 Attempt to present ViewController whose view is not in the window hierarchy
body: <p>I am using <code>swift 4</code> and I am trying to create an <code>alertView</code> when I there is an error while signing up a user using <code>Firebase</code>. I have an <code>IBAction</code> for the sign up button which will sign the user up using text from two <code>textfields</code>, one for email and one for password. </p>
  
  <p>I am basically trying to show an <code>alertview</code> when there is an error with the sign up process, for example there is an empty <code>textfield</code>.</p>
  
  <p><a href="https://i.stack.imgur.com/L4zMz.png" rel="noreferrer"><img src="https://i.stack.imgur.com/L4zMz.png" alt="enter image description here"></a></p>
  
  <p>I have attached a screenshot of the function to where that is occuring. I know that I am in fact getting an error because the print statement outputs an error if there is one. </p>
  
  <p>Regardless of if there is an error or not, there is no alert view showing up and the app performs the segue regardless. </p>
  
  <blockquote>
    <p>2019-01-15 21:40:26.368924-0500 Pronto[9036:225268] Warning: Attempt
    to present  on
     whose view is not in the
    window hierarchy</p>
  </blockquote>
  
  <p>This is the output that I am getting for the alertview now showing up.
  I have looked at all the other posts about this same issue but none seem to work.</p>