Popularity
5.3
Stable
Activity
3.2
Stable
515
7
45

Code Quality Rank: L4
Programming language: Swift
License: GNU General Public License v3.0 or later
Tags: Text    
Latest version: v2.1.0

Smile alternatives and similar libraries

Based on the "Text" category.
Alternatively, view Smile alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of Smile or a related project?

Add another 'Text' Library

README

Smile

❀️ Support my apps ❀️

β€οΈβ€οΈπŸ˜‡πŸ˜πŸ€˜β€οΈβ€οΈ

Emoji in Swift. For reference, go to https://github.com/onmyway133/emoji

CI Status Version Carthage Compatible License Platform Swift

[](Screenshots/Banner.png)

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
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.


*Note that all licence references and agreements mentioned in the Smile README section above are relevant to that project's source code only.