swiftuilabelnsattributedstringnstextattachment

Inserting multiple images in UILabel


I know how to insert a UIImage inside a UILabel but I am not sure how insert more than one image as appending the new image to the attributed string will always discard the previous attached image.

Is there a way to insert multiple images or maybe even replace specific characters with images,


Solution

  • I ended up modifying the font I was using and drawing my own emojis. The key was in figuring out how to export colored glyphs that retain their color despite what color you set for the string.

    https://help.fontlab.com/fontlab-vi/Color-Glyphs/

    https://help.fontlab.com/fontlab-vi/Color-Font-Formats/