I get the above error when trying to create a function to check user inputs and store data. My project builds fine until I reach this function `RegisterButtonTapped()`. Does anyone have some structural or syntax changes that could get rid of this error?

```
   @IBAction func RegisterButtonTapped(sender: AnyObject) {

    let userEmail = userEmailTextField.text;
    let userPassword = userEmailTextField.text;
    let userRepeatPassword = userRepeatPasswordTextField.text;

    // Check for empty fields
    if(userEmail!.isEmpty || userPassword!.isEmpty || userRepeatPassword!.isEmpty){

        displayAlertMessage("All fields are required");

        return;
    }

    // Check if passwords match
    if(userPassword != userRepeatPassword){

        displayAlertMessage("Passwords do not match");

        return;
    }

    // Store Data
    NSUserDefaults.standardUserDefaults().setObject(userEmail, forKey: "userEmail");
    NSUserDefaults.standardUserDefaults().setObject(userEmail, forKey: "userPassword");
    NSUserDefaults.standardUserDefaults().synchronize();

    // Display Alert message with confirmation
    var myAlert = UIAlertController(title:"Alert",message:"Registration is successful, thank you.",preferredStyle: UIAlertControllerStyle.Alert);

    func displayAlertMessage(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);
    } // END OF FUNCTION 'displayAlertMessage()'

} // END of FUNCTION 'RegisterButtonTapped()'

```