Skip to content

Instantly share code, notes, and snippets.

@aug2uag
Last active January 3, 2016 12:39
Show Gist options
  • Select an option

  • Save aug2uag/8464566 to your computer and use it in GitHub Desktop.

Select an option

Save aug2uag/8464566 to your computer and use it in GitHub Desktop.
NSString is all digits
- (BOOL)isAllDigits:(NSString *)input
{
NSCharacterSet* nonNumbers = [[NSCharacterSet decimalDigitCharacterSet] invertedSet];
NSRange r = [input rangeOfCharacterFromSet: nonNumbers];
return r.location == NSNotFound;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment