title: Displaying an alert in Swift
body: <p>I'm learning swift and I'm building a UI for an app, I wanted to know what was wrong with my code because it keeps saying I have errors.</p>
  
  <pre><code>let userEmail = userEmailTextField.text;
  let userPassword = userPasswordTextField.text;
  let userRepeatPassword = repeatPasswordTextField.text;
  
  // check for empty fields
  if((userEmail.isEmpty || userPassword.isEmpty || userRepeatPassword.isEmpty)
  {
  
      //Display alert message
      displayMyAlertMessage("Alert fields are required");
      return;
  }
  
  //check if passwords match
  if(userPassword != userRepeatPassword) 
  // error expected expression in list of expression
  {
  
      //Display alert message
      displayMyAlertMessage("Alert fields are required");
      return;
  }  
  </code></pre>
  
  <blockquote>
    <p>expected  '(" after if condition</p>
  </blockquote>
  
  <pre><code>func displayMyAlertMessage(userMessage: String)
  {
      var myAlert = UIAlertController(
          title: "Alert", 
          message: userMessage, 
          PrefferedStyle:UIAlertController.Alert);
  }
  </code></pre>
  
  <blockquote>
    <p>error Type"UIAlertController'has no member 'Alert'</p>
  </blockquote>
  
  <p>Just need help figuring out the errors for the code</p>