I have a UITextField where we can enter either email id or our phone number. My question is it possible to check whether the text entered in the UITextField is a phone number or emailID on a button click in Swift3? Currently i am using the following code:
func isNumber(text:String)->Bool
{
if let intVal = text.toInt()
{return true}
else
{return false}
}
But it can validate, input is integer or not. Is it possible to know whether the input is emailID or phone number?