+ (BOOL)validateUrl: (NSString *)candidate
{
NSString *candidateUrlString = candidate;
if (![candidate.lowercaseString hasPrefix:@"http://"] && ![candidate.lowercaseString hasPrefix:@"https://"]) {
candidateUrlString = [NSString stringWithFormat:@"http://%@", candidate];
}
NSString *urlRegEx = @"(http|https)://((\\w)*|([0-9]*)|([-|_])*)+([\\.|/]((\\w)*|([0-9]*)|([-|_])*))+";
NSPredicate *urlTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", urlRegEx];
return [urlTest evaluateWithObject:candidateUrlString];
}