I need to validate an international phone number.
I know its difficult to validate an international phone number, so I\'m going to keep it simple:
+
In swift 4 -
func ValidateMobileNumber(txtFeid : UITextField, strChk : String, range: NSRange) -> Bool {
if txtFeid.text!.count >= 10 {
return false
}
let formatePre = "^((\\+)|(00))[0-9]{6,14}$"
let resultPredicate : NSPredicate = NSPredicate(format: "SELF MATCHES %@",formatePre)
return resultPredicate.evaluate(with: strChk)
}