NSString addition for iOS5+ Emoji.
Install via CocoaPods
pod 'YIEmoji'
To support iOS4, see tag 0.1 for more info.
NSString* text = @"😄😊😃☺1⃣test2⃣☀☔☁⛄";
NSLog(@"hasEmoji = %d",[text hasEmoji]); // YES
NSLog(@"trueLength = %d",[text emojiContainedTrueLength]); // 14
NSLog(@"emojiTrimmedString = %@",[text stringByTrimmingEmojis]); // test
- Add unit test
- Add OSX compatibility
- punchdrunker/iOSEmoji (Japanese docs)
YIEmoji is available under the Beerware license.
If we meet some day, and you think this stuff is worth it, you can buy me a beer in return.