Contents

NSAdaptiveImageGlyph

A data object for an emoji-like image that can appear in attributed text.

Declaration

class NSAdaptiveImageGlyph

Overview

An NSAdaptiveImageGlyph contains an image that automatically adapts to different sizes and resolutions. The text system creates instances of this type to represent custom emojis that people create using the system interfaces. This type manages multiple images, along with metadata describing how to adapt those images correctly to different fonts and font attributes.

Typically, you receive new NSAdaptiveImageGlyph objects only from the text-input system. When someone creates a new emoji and inserts it into their text, TextKit creates an instance of this type to represent it. If your app examines or changes the attributes of attributed strings, preserve the adaptiveImageGlyph attribute when making any changes. For example, if you filter unknown attributes in a custom text-storage object, update your code to preserve this attribute. The value of the attribute is an NSAdaptiveImageGlyph containing the emoji data. You can save the image data with the rest of your content and use the data to recreate the type later.

Topics

Creating an adaptive image glyph

Getting the image data

Getting the content metadata

Initializers

See Also

Attachments