Smile
- Push Hero - pure Swift native macOS application to test push notifications
- PastePal - Pasteboard, note and shortcut manager
- Quick Check - smart todo manager
- Alias - App and file shortcut manager
- My other apps
Emoji in Swift. For reference, go to https://github.com/onmyway133/emoji
Features
- Support emoji sequences
- Handle skin tones, marks, genders, variation selectors
- Support new iOS emojis
List
List all emojis
Smile.list()
emojiList
emojiCategories
Emoji
Check if a character is emoji
Smile.isEmoji(character: "๐") // true
Check if a string contains any emoji
Smile.containsEmoji(string: "๐ and ๐") // true
Count number of emoji characters in a string
Smile.countEmoji("๐ and ๐") // 2
Count number of non-emoji characters in a string
Smile.countNonEmoji("๐ and ๐") // 5
Check if a string contains only a single emoji
Smile.isSingleEmoji("๐ and ๐") // false
Smile.isSingleEmoji("๐จโ") // true
Smile.isSingleEmoji("๐ฉ๐ฝโ๐งโ") // false
Smile.isSingleEmoji("just plain text") // false
Check if a string contains only emojis
Smile.isEmojiOnly("๐ and ๐") // false
Smile.isEmojiOnly("๐จโ") // true
Smile.isEmojiOnly("๐ฉ๐ฝโ๐งโ") // true
Smile.isEmojiOnly("just plain text") // false
Get 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_castle
Replace 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: "๐") // people
Manipulation
Extract all emojis within a string
Smile.extractEmojis(string: "Find ๐and๐") // ๐๐
Remove all emojis within a string
Smile.removeEmojis(string: "Find ๐and๐") // Find and
Assemble
Smile.assemble(emojis: ["๐จ", "๐ซ") // ๐จโ๐ซ
Smile.assemble(emojis: ["๐จ", "๐ฉ", "๐ง", "๐ฆ"] // ๐จโ๐ฉโ๐งโ๐ฆ
Disassemble
Smile.disassemble(emoji: "๐จโ๐ซ") // [๐จ, ๐ซ]
Script
Update emoji list by running
node parser.js
Installation
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"
Author
Khoa Pham, [email protected]
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.