How to validate email in iOS Objective- C?

Total Post:45

Points:323
iOS
 726  View(s)
Ratings:
Rate this:
How to validate email in iOS Objective- C?
  1. Post:110

    Points:774
    Re: How to validate email in iOS Objective C?

     You can validate email using the following objective c code-

     

    -(BOOL)isValidEmail:(NSString
    *)emailString
    {
    NSString *filterString = @"^[A-Z0-9a-z\\._%+-]+@([A-Za-z0-9-]+\\.)+[A-Za-z]{2,4}$";
    NSPredicate *emailPredicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", filterString];
    return [emailPredicate evaluateWithObject:emailString];
    }
     

      Modified On Apr-11-2018 06:01:22 AM

Answer