In iOS App, how to add Email validation on UITextField?
- (BOOL)validateEmailAddress:(NSString*)yourEmail
{
//create a regex string which includes all email validation
NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}";
//create predicate with format matching your regex string
NSPredicate *email = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex];
//return True if your email address matches the predicate just formed
return [email evaluateWithObject:yourEmail];`
}