Follow by Email

Search This Blog

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;
    

}

No comments:

Post a Comment