Quantcast
Viewing latest article 1
Browse Latest Browse All 6

Answer by Kiran Bhoraniya for URL Validation function improving

-(BOOL)validateUrl{//    NSString *urlRegEx =  @"((?:http|https)://)?(www\\.)[\\w\\d\\-_]+\\.\\w{2,3}(\\.\\w{2})?(/(?<=/)(?:[\\w\\d\\-./_]+)?)?";    NSString *urlRegEx =  @"((?:http|https)://)?(www\\.)[\\w\\d\\-_]+\\.\\w{2,3}(\\.\\w{2})?(/(?<=/)(?:[\\w\\d\\-./_]+)?)?";    NSPredicate *urlTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", urlRegEx];    if ([urlTest evaluateWithObject: self] == YES) {        NSLog(@"URL is valid!");    } else {        NSLog(@"URL is not valid!");    }    return [urlTest evaluateWithObject:self];}

Viewing latest article 1
Browse Latest Browse All 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>