Search This Blog

Showing posts with label phone no validation. Show all posts
Showing posts with label phone no validation. Show all posts

Thursday, 20 November 2014

iOS Phone No Validation



-(BOOL)checkValidation :(NSString *)phoneNo
{
    NSString *phoneRegex = @"((971)\\d{9})";
    NSPredicate *phoneTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", phoneRegex];
    
    BOOL phoneValidates = [phoneTest evaluateWithObject:phoneNo];
    return phoneValidates;
    

}