Swiftpack.co - divadretlaw/EmojiText as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by divadretlaw.
divadretlaw/EmojiText v1.4.0
Render Custom Emoji in Text
⭐️ 12
🕓 3 days ago
iOS
.package(url: "https://github.com/divadretlaw/EmojiText.git", from: "v1.4.0")

EmojiText

Render Custom Emoji in Text. Supports local and remote emojis. Remote emojis are loadad and cached using Nuke

Usage

Remote emoji

EmojiText(verbatim: "Hello World :my_emoji:",
          emojis: [RemoteEmoji(shortcode: "my_emoji", url: /* URL to emoji */)])

Local emoji

EmojiText(verbatim: "Hello World :my_emoji:",
          emojis: [LocalEmoji(shortcode: "my_emoji", image: /* some UIImage */)])

Markdown

Also supports Markdown

EmojiText(markdown: "**Hello** *World* :my_emoji:",
          emojis: [RemoteEmoji(shortcode: "my_emoji", url: /* URL to emoji */)])

Configuration

Remote emojis are replaced by a placeholder image. Default is the SF Symbol square.dashed but you can provide a placeholder image with

.environment(\.placeholderEmoji, /* some UIImage */)

Remote emojis use ImagePipeline.shared from Nuke but you can provide a custom pipline with

.environment(\.imagePipeline, ImagePipeline())

License

See LICENSE

GitHub

link
Stars: 12
Last commit: 3 days ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

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