onmyway133/smile
❤️ Support my apps ❤️
Features
- [x] Support emoji sequences
- [x] Handle skin tones, marks, genders, variation selectors
- [x] Support new iOS emojis
List
List all emojis
Smile.list()
emojiList
emojiCategoriesEmoji
Check if a character is emoji
Smile.isEmoji(character: "🎉") // trueCheck if a string contains any emoji
Smile.containsEmoji(string: "🎈 and 🎁") // trueCount number of emoji characters in a string
Smile.countEmoji("🎈 and 🎁") // 2Count number of non-emoji characters in a string
Smile.countNonEmoji("🎈 and 🎁") // 5Check if a string contains only a single emoji
Smile.isSingleEmoji("🎈 and 🎁") // false
Smile.isSingleEmoji("👨") // true
Smile.isSingleEmoji("👩🏽🧑") // false
Smile.isSingleEmoji("just plain text") // falseCheck if a string contains only emojis
Smile.isEmojiOnly("🎈 and 🎁") // false
Smile.isEmojiOnly("👨") // true
Smile.isEmojiOnly("👩🏽🧑") // true
Smile.isEmojiOnly("just plain text") // falseGet emoji from unicode values
XCTAssertEqual(Smile.emoji(unicodeValues: [0x1F47B]), "👻")
XCTAssertEqual(Smile.emoji(unicodeValues: [0x0001F468, 0x200D, 0x2708]), "👨✈")Unmodify an emoji
Smile.unmodify(emoji: "👨🏿") // 👨Name
Show standard name of an emoji
Smile.name(emoji: "🇳🇴") // ["REGIONAL INDICATOR SYMBOL LETTER N", "REGIONAL INDICATOR SYMBOL LETTER O"])Search emoji by keywords
Smile.emojis(keywords: ["GRINNING"]) // 😁, 😸Flag
Search emoji flag by country code
Smile.emoji(countryCode: "no") // 🇳🇴Alias
Search emoji by alias
Emoji data is from https://github.com/github/gemoji/blob/master/db/emoji.json
Smile.emoji(alias: "japanese_castle") // 🏯Find alias by emoji
Smile.alias(emoji: "🏯") // japanese_castleReplace alias within a string
Smile.replaceAlias(string: ":santa: is coming to :european_castle:") // 🎅 is coming to 🏰Category
Find category of emoji
Emoji data is from https://github.com/github/gemoji/blob/master/db/Category-Emoji.json
Smile.category(emoji: "😁") // peopleManipulation
Extract all emojis within a string
Smile.extractEmojis(string: "Find 🔑and🔎") // 🔑🔎Remove all emojis within a string
Smile.removeEmojis(string: "Find 🔑and🔎") // Find andAssemble
Smile.assemble(emojis: ["👨", "🏫") // 👨🏫
Smile.assemble(emojis: ["👨", "👩", "👧", "👦"] // 👨👩👧👦Disassemble
Smile.disassemble(emoji: "👨🏫") // [👨, 🏫]Script
Update emoji list by running
node parser.jsInstallation
Smile is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'Smile'Smile is also available through Carthage. To install just write into your Cartfile:
github "onmyway133/Smile"Contributing
We would love you to contribute to Smile, check the CONTRIBUTING file for more info.
License
Smile is available under the MIT license. See the LICENSE file for more info.
Package Metadata
Repository: onmyway133/smile
Default branch: master
README: README.md