Skip to content

Instantly share code, notes, and snippets.

View qchenqizhi's full-sized avatar
🎯
Staring

Chen qchenqizhi

🎯
Staring
View GitHub Profile
@qchenqizhi
qchenqizhi / gist:4029296
Created November 7, 2012 02:41
NSString has emoji
// Reference:
// https://github.com/iamcal/php-emoji
// http://de.wikipedia.org/wiki/Unicode-Block_Kombinierende_diakritische_Zeichen_f%C3%BCr_Symbole
- (BOOL)hasEmoji
{
__block BOOL emoji = NO;
[self enumerateSubstringsInRange:NSMakeRange(0, self.length)
options:NSStringEnumerationByComposedCharacterSequences
usingBlock:^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) {