i am using the following code for phone number validation. But i am getting the following error. I cant able to proceed further. Help us to take it forward.
The following code works in xcode 6.3 beta
func isValidEmail(testStr:String) -> Bool {
let emailRegEx = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"
let range = testStr.rangeOfString(emailRegEx, options:.RegularExpressionSearch)
let result = range != nil ? true : false
return result
}
how to use it:
Ex.
if isValidEmail(email.text) == false{
//your code here
}