You might be thinking: There’s actually no AI in this module. To get Genmoji into your app, you just need to provide a TextEditor that supports adaptive image glyph. The emoji keyboard does the rest. Once you’ve got text with Genmoji into your app, stored in an AttributedString, you need to display it, possibly modify it, and save it to disk in a way that preserves the Genmoji data.
In lesson 1, you used a TextEditor to get Genmoji input and copy-pasted this input into another TextEditor. The input is an AttributedString so you can display it in a Text view. It’s easier and more type-safe to modify attributes of an AttributedString than an NSAttributedString. On the other hand, saving NSAttributedString to disk is more robust and straightforward than AttributedString, especially with Swift Data. It’s just as easy to convert a modified AttributedString back to NSAttributedString, so you get the best of both worlds.
You can serialize NSAttributedString into several document formats, including RTFD, HTML and even Microsoft Word XML. And you can decompose an NSAttributedString to extract its adaptive image glyph data to use in non-rich-text formats.
Here’s what you’ll learn in this lesson:
How to display Genmoji in plain text and HTML formats.
How to serialize and deserialize an NSAttributedString while preserving its adaptive image glyphs.
See forum comments
This content was released on Oct 10 2025. The official support period is 6-months
from this date.
Set the stage and introduce the LOs.
Download course materials from Github
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.