Skip to main content
This guide adds a color button to the composer’s formatting toolbar. The iOS v6 Kit cannot render colored text in a sent message yet:
  • RichTextFormat has no color — the formats are bold, italic, underline, strikethrough, inline code, code block, link, bulleted list, numbered list and quote.
  • Message bubbles draw mentions and markdown from the message itself and do not run your text formatters, so a {color:…} token you put in the text would show as typed.
What iOS v6 does have is the authoring half: your own button at the end of the formatting toolbar, with a live handle on the input.

Your own toolbar button

The button receives a ComposerInputController while the composer is on screen. Read the text and the selection, insert or replace text, or toggle one of the built-in formats:
FormattingComposer.swift
The slot lives inside the formatting toolbar: it is not shown while the toolbar is hidden, or in a chat with an AI agent. Do not keep the controller after the view goes.

Next Steps

Message Composer

Rich-text formatting and the toolbar

Text Formatter Base Class

What formatters can and cannot change

Message Template

Replace how a message kind is drawn

All Guides

Browse the other guides