             if(email.characters.count == 0) {
                 self.emailField.errorMessage = nil
             }
-            else if(!isValidEmail(str: email)) {
+            else if validateEmail(email) == false {
                 self.emailField.errorMessage = NSLocalizedString("Email not valid", tableName: "SkyFloatingLabelTextField", comment: " ")
             } else {
                 self.emailField.errorMessage = nil

    func textFieldShouldReturn(_ textField: UITextField) -> Bool {
        // Validate the email field
        if (textField == self.emailField) {
            self.validateEmailTextFieldWithText(email: textField.text)
        }
        
        // When pressing return, move to the next field

        return false
    }
    
    @IBAction func validateEmailField() {
        validateEmailTextFieldWithText(email: emailField.text)
    }
    
    func validateEmailTextFieldWithText(email: String?) {
