Simple SWIFT library for Name, Email, Password and Digit Validation
- Name Validation.
- Email Validation.
- Customizable Password Options.
- Detect Digit Value.
- Text Validation without extra spaces.
- Shows error - front and back extra spaces. eg:- " Andrew", "Andrew ", "James Andrew ", " James Andrew "
- Shows error - Digits in the name text. eg:- "Andrew12", "Andre1w"
- Shows error - Extra spaces with two name (More than one space). eg:- "James Andrew", "James Andrew"
- Shows error - If name field is empty.
- Minimum 8 characters at least 1 Alphabet and 1 Number
- Minimum 8 characters at least 1 Alphabet, 1 Number and 1 Special Character
- Minimum 8 characters at least 1 Uppercase Alphabet, 1 Lowercase Alphabet and 1 Number
- Minimum 8 characters at least 1 Uppercase Alphabet, 1 Lowercase Alphabet, 1 Number and 1 Special Character
- Minimum 8 and Maximum 10 characters at least 1 Uppercase Alphabet, 1 Lowercase Alphabet, 1 Number and 1 Special Character:
- Any 8 characters
Simply copy and paste FormValidator File on your Project :)
First you need to create FormField Objects in order to pass FormField Array to FormValidator Class.
let userEmailForm = FormField(text: self.userEmail.text!, fieldType: .email, fieldName: "Email Address")
let userPasswordForm = FormField(text: self.userEmail.text!, fieldType: .password, fieldName: "Password")
Then you can Pass Field data Array to FormValidator Class.
FormValidator.checkFieldsValidity(fields: [userEmailForm, userPasswordForm]) { (msg) in
if msg.valid {
print("Correct Data")
} else {
print(msg.errorMsg!)
}
}
case text
case name
case email
case digit
case password