Swiftpack.co -  yochidros/TwemojiKit as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
yochidros/TwemojiKit
TwemojiKit is tools for parsing string to Twemoji
.package(url: "https://github.com/yochidros/TwemojiKit.git", from: "0.4.0")

TwemojiKit

license [ TwemojiKit is simple library that provide Twemoji image URL, using twemoji core library.

What is it ?

TwemojiKit is wrapper class for twemoji library. It can parse iOS emoji to twemoji.

Requirements

TwemojiKit requires iOS 11.0 or above, and swift 5.

Installation

  • Add sources files to your project.
  • CocoaPods

    pod 'TwemojiKit'
    
  • Carthage

    github "yochidros/TwemojiKit"
    

Usage

Simple Example.

emoji = "✌️"

 let twemoji = Twemoji.shared.parse(emoji)

its return [TwemojiImage]

[
 TwemojiImage(
    - base : "✌️"
    - size : TwemojiKit.TwemojiSize.x72
    - code : "270c"
    - ext : ".png"
 )
]

Normal Text With,

text = "Hello, 🐶"

  let withText = Twemoji.shared.parse(text)

return

[
 TwemojiImage(
  - base : "🐶"
    - size : TwemojiKit.TwemojiSize.x72
    - code : "1f436"
    - ext : ".png"
 )

Mutli Emojis Example,

 let emojis = "🐱 and 🐶"

return

[
  0 : TwemojiImage
    - base : "🐱"
    - size : TwemojiKit.TwemojiSize.x72
    - code : "1f431"
    - ext : ".png"
  1 : TwemojiImage
    - base : "🐶"
    - size : TwemojiKit.TwemojiSize.x72
    - code : "1f436"
    - ext : ".png"
]

Options

  • If want to use as UILabel attributedText.
  let attrStr = Twemoji.shared.parseAttributeString("💪 muscle")
  label.attributedText = attrStr
  • Image Only
guard let firstImage = Twemoji.shared.parse("🐶").first else { return }
imageView.image = Twemoji.shared.convertImage(twemoji: firstImage)

Dependencies

Author

yochidros, mm9.movement.trb@gmail.com

License

TwemojiKit is available under the MIT license. See the LICENSE file for more info.

GitHub

link
Stars: 2
Last commit: 25 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Release Notes

Add: Swift Package Manager
25 weeks ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API