1234567891011121314151617181920212223242526 |
- //
- // Validation.swift
- // Learn Genie
- //
- // Created by Suraj Kumar Mandal on 18/09/21.
- //
- import Foundation
- class Validation {
-
- func isValidEmail(_ email: String) -> Bool {
- let emailRegEx = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,64}"
- let emailPred = NSPredicate(format:"SELF MATCHES %@", emailRegEx)
- return emailPred.evaluate(with: email)
- }
-
- func isValidPhoneNo(_ phone: String) -> Bool {
- if phone.count != 10 {
- return false
- } else {
- return true
- }
- }
-
- }
|