title: Error "{ expected after if statement"
body: <p>I am attempting to get Firebase set up in my app and I'm attempting to add a few conditions for if somebody's login information is not correct. I added <code>user, error in</code>. For some reason I can seem to get the if statements to work properly. Any line with the following <code>if error!=nil{</code> comes up with the error <code>expected "{" after if declaration</code></p>
  
  <pre><code>//
  //  RegistrationViewController.swift
  //  StudyBuddy
  //
  //  Created by Basel Anani on 7/25/16.
  //  Copyright © 2016 StudyBuddy. All rights reserved.
  //
  
  import UIKit
  import Firebase
  
  class RegistrationViewController: UIViewController {
  
      @IBOutlet weak var userEmailTextField: UITextField!
      @IBOutlet weak var userPasswordTextField: UITextField!
      @IBOutlet weak var userConfirmPasswordTextField: UITextField!
  
      override func viewDidLoad() {
           super.viewDidLoad()
  
          // Do any additional setup after loading the view.
      }
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
          // Dispose of any resources that can be recreated.
      }
  
      @IBAction func registerButtonTapped(sender: AnyObject) {
  
          let userEmail = userEmailTextField.text;
          let userPassword = userPasswordTextField.text;
          let userConfirmPassword = userConfirmPasswordTextField.text;
  
          //Check for Empty Fields
          FIRAuth.auth()?.createUserWithEmail(userEmailTextField.text!, password: userPasswordTextField.text!, completion: {
  
              user, error in
  
              if error !=nil{
  
              }
              else {
                  print("User Created")
                  self.login()
              }
          })
  
          func login(){
                  FIRAuth.auth()?.signInWithEmail(userEmailTextField.text!, password: userPasswordTextField.text!, completion: {
                  user, error in
  
                  if error !=nil {
  
                      print("Incorrect")
                  }
                  else{
  
                      print("Login Successful")
                  }
  
  
  
  
          })
  
  
  
          //Save Stored Data
  
      func displayMyAlertMessage(userMessage:String) {
  
          var myAlert = UIAlertController(title: "Alert", message:     "userMessage", preferredStyle: UIAlertControllerStyle.Alert);
  
          let okAction = UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil);
  
          myAlert.addAction(okAction);
  
          self.presentViewController(myAlert, animated: true, completion: nil);
  
          if (userEmail!.isEmpty) {
  
              displayMyAlertMessage("All fields are required");
  
  
              return;
          }
  
          if (userPassword!.isEmpty) {
  
              displayMyAlertMessage("All fields are required");
  
              return;
          }
  
          if (userConfirmPassword!.isEmpty) {
  
               displayMyAlertMessage("All fields are required");
  
              return;
          }
  
          if userPassword != userConfirmPassword {
              displayMyAlertMessage("Passwords do not match");
          }
  
      }
  
  
  
          }}}
  </code></pre>