Swiftpack.co -  GetStream/Streamoji as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
:godmode: Custom emoji rendering library for iOS apps with support for GIF & still images - plug-in extension for UITextView - performance, cache βœ… - Made with πŸ’˜ by @GetStream
.package(url: "https://github.com/GetStream/Streamoji.git", from: "0.1.8")

GitHub Workflow Status Cocoapods Cocoapods platforms SPM & Carthage compatible License Twitter Twitter Follow

Custom emojis are a fun way to bring more life and customizability to your apps. They're available in some of the most popular apps, such as Slack, Discord, and Twitch. However, iOS SDK doesn't provide straight forward support for custom emojis out of the box. Now, you're a couple code lines away from adding them to your own app with this library.

Streamoji is a custom emoji rendering library for iOS. It supports GIF , images , and unicode 🦊. It loads from URLs or local assets. Caching is taken care of and performance is ⚑️ fast! Made with πŸ’˜ by the folks @ Stream.


1. Define Emojis

First step is to define your custom emojis in a dictionary with the key being the :shortcode: for the emoji and the EmojiSource being the, uhmmm, source of the emoji! It can be from GIF or image in a local asset, remote URL, or even a unicode character. You can also define aliases (alternate codes).

let exampleEmojis: [String: EmojiSource] = [
    "baby_yoda": .imageAsset("baby-yoda-soup.gif"),
    "banana_dance": .imageAsset("bananadance.gif"),
    "excuse_me": .imageAsset("excuseme.gif"),
    "party_parrot": .imageAsset("party_parrot.gif"),
    "this_is_fine": .imageAsset("this-is-fine-fire.gif"),
    "what": .imageAsset("what.png"),
    "homer_disappear": .imageAsset("homer-disappear.gif"),
    "let_me_in": .imageUrl("https://github.com/GetStream/Streamoji/blob/main/meta/emojis/let_me_in.gif?raw=true"),
    "smiley": .character("πŸ˜„"),
    "heart": .character("❀️"),
    "banana": .alias("banana_dance"),
    "parrot": .alias("party_parrot")

2. Configure UITextView

After defining your emojis, you should call UITextView.configureEmojis:

textView.attributedText = NSAttributedString(string:
    :banana_dance: Streamoji :party_parrot:
    :baby_yoda: This is a UITextView! :excuse_me:

    GIF :this_is_fine:
    Image :what:
    Local file :homer_disappear:
    Remote file :let_me_in:
    Unicode :smiley:

textView.configureEmojis(exampleEmojis, rendering: .highestQuality)

You can also tweak a couple (for now) rendering options: quality and scale in relation to the surrounding text.


To run the example project, clone the repo, and run pod install from the Example directory first.


Streamoji is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'Streamoji'


@cardoso, matheus@getstream.io


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


Stars: 222
Last commit: 44 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

44 weeks ago

Support unicode characters inside :shortcodes:. Eg: :⌘:

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