license [ TwemojiKit is simple library that provide Twemoji image URL, using twemoji core library.
TwemojiKit is wrapper class for twemoji library. It can parse iOS emoji to twemoji.
TwemojiKit requires iOS 11.0 or above, and swift 5.
- Add sources files to your project.
-
pod 'TwemojiKit'
-
github "yochidros/TwemojiKit"
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"
]
- 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)
yochidros, [email protected]
TwemojiKit is available under the MIT license. See the LICENSE file for more info.