Created
May 7, 2015 09:02
-
-
Save dabing1022/3696b1ce8cb265c4c037 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSArray *)matchUrlInString:(NSString *)string | |
{ | |
NSError *error = NULL; | |
NSDataDetector *detectorLink = [NSDataDetector dataDetectorWithTypes:NSTextCheckingTypeLink error:&error]; | |
NSArray *urlMatchArr = [detectorLink matchesInString:string options:NSMatchingReportCompletion range:NSMakeRange(0, string.length)]; | |
return urlMatchArr; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment