Swiftpack.co - yochidros/TwemojiKit as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by yochidros.
yochidros/TwemojiKit 0.4.1
TwemojiKit is tools for parsing string to Twemoji
⭐️ 3
🕓 1 week ago
iOS
.package(url: "https://github.com/yochidros/TwemojiKit.git", from: "0.4.1")

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, [email protected]

License

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

GitHub

link
Stars: 3
Last commit: 2 weeks ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

0.4.1
2 weeks ago

What's Changed

New Contributors

Full Changelog: https://github.com/yochidros/TwemojiKit/compare/0.4.0...0.4.1

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