Skip to content

Instantly share code, notes, and snippets.

@mikeabdullah
Last active August 29, 2015 14:13
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikeabdullah/0bfa45534dc0b75e32a8 to your computer and use it in GitHub Desktop.
Save mikeabdullah/0bfa45534dc0b75e32a8 to your computer and use it in GitHub Desktop.
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