Create a gist now

Instantly share code, notes, and snippets.

Date parsing with NSDataDetector
NSDataDetector *detector = [NSDataDetector
dataDetectorWithTypes:NSTextCheckingTypeDate
error:NULL];
NSTextCheckingResult *result = [detector
firstMatchInString:string
options:0
range:NSMakeRange(0, string.length)];
return result.date;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment