EmojiTools 1.0.1

EmojiTools 1.0.1

TestsTested βœ“
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Jan 2016
SPMSupports SPM βœ—

Maintained by Todd Kramer.



  • By
  • Todd Kramer

EmojiTools

Tools for detecting emoji in strings and using emoji shortcut codes.

Features

  • supports all emojis including new ones released in iOS 9
  • detect that a string contains emoji
  • detect that a string contains emoji only, optionally allowing for whitespace (defaults to true)
  • convert emoji shortcut codes in strings into their emoji equivalents
  • get suggested emoji shortcut codes from a search string

Requirements

Since EmojiTools is a dynamic framework, iOS 8 or above is required

Manual Installation

To install EmojiTools manually:

  1. Download, clone, or submodule EmojiTools.
  2. Drag the EmojiTools.xcodeproj file into your project under the Products folder
  3. In your target’s Build Phases settings, add EmojiTools to the Target Dependencies build phase.
  4. Add the EmojiTools.framework product to the Link Binary With Libraries build phase.
  5. If there is no Copy Files build phase, add one.
  6. Add EmojiTools.framework to the Copy Files build phase and set the destination to Frameworks

Usage

Emoji Detection:

import EmojiTools

func someFunction() {
    let emojiContainingString = "This πŸ˜€πŸ˜ŽπŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘§ string πŸŒ²πŸ―πŸŒ› has πŸ‰β˜•οΈπŸ» a πŸŽ†πŸ€πŸŽΌ lot πŸšŒπŸ—½βœˆοΈ of πŸ“žπŸ”¦βœ‰οΈ emoji. 8οΈβƒ£πŸ”‘πŸ•’"
    let containsEmoji = emojiContainingString.containsEmoji() // true 
    let emojiOnlyWhitespaceString = "πŸ˜€πŸ˜ŽπŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘§ πŸŒ²πŸ―πŸŒ› πŸ‰β˜•οΈπŸ» πŸŽ†πŸ€πŸŽΌ   πŸšŒπŸ—½βœˆοΈ     πŸ“žπŸ”¦βœ‰οΈ 8οΈβƒ£πŸ”‘πŸ•’"
    let containsEmojiOnly = emojiOnlyWhitespaceString.containsEmojiOnly() // true
    let containsEmojiOnlyAndNoWhitespace = emojiOnlyWhitespaceString.containsEmojiOnly(false) // false
}

Emoji Shortcut Codes

import EmojiTools

func someFunction() {
    let emojiShortcutCodeString = "The :monkey: is trying to buy a :banana: with some :moneybag: at the :convenience_store:."
    let processedEmojiString = emojiShortcutCodeString.emojiString() // "The πŸ’ is trying to buy a 🍌 with some πŸ’° at the πŸͺ."
}

Author

License

EmojiTools is available under the MIT license. See the full license here.