CometChatMessageList is the scrolling conversation between the header and the composer.
It fetches a chat’s messages, pages back through history, stays live, and draws every
message kind as a bubble: text, images and videos, files, audio and voice notes, stickers,
polls, meetings, collaborative documents, cards and AI replies.

Where It Fits
Place it between the message header and the message composer, and give it the chat’sUser
or Group — and a parent message for a thread.
MessageListStore, shared by both toolkits.
Quick Start
- SwiftUI
- UIKit
The list fills the screen, and the header and the composer are bars over it. The rows scroll
under their Liquid Glass on iOS 26 and still come to rest clear of them. Host the bars with

safeAreaBar on iOS 26: it also carries the list’s scroll edge effect under each bar, so the
rows fade softly behind it. Earlier versions have no edge effect, and safeAreaInset hosts the
bars the same way. Stacked in a VStack instead, nothing passes under the bars and the glass
has nothing to show.
- SwiftUI
- UIKit
parentMessageId still works but is deprecated: it is read only when
parentMessage is nil. Pass the message, so replies arriving live carry its thread
subscription state.autoFetch: false the list takes the chat but fetches nothing. user wins when both
user and group are given, but the chat still counts as a group for avatars and names.Filtering Messages
The list’s default request fetches only the Kit’s own message types. A request builder replaces it whole: the list adds the user or group, so set the types, categories, page size,hideReplies and — for a thread — the parent message id yourself.
- SwiftUI
- UIKit
Pass
messagesRequestBuilder, a closure that returns the builder. Live messages are filtered by
the same types.What the List Shows
- SwiftUI
- UIKit
The list opens at the newest message. Scrolling to the top loads the older page, with a
spinner above the first row; after a jump, scrolling to the bottom loads newer messages the
same way.
Separators and the Sticky Date
- SwiftUI
- UIKit
A date separator heads each day: “Today”, “Yesterday”, then a date. While the list
scrolls, the top row’s day stays pinned as a sticky date. With

startFromUnreadMessages: true the list opens at the first unread message, marked by a
new-messages separator.
New Messages and the Indicator
- SwiftUI
- UIKit
At the bottom, the list follows new messages. Scrolled up, it stays where it is and shows
the new-message indicator — an arrow with a count, “999+” at most. A tap scrolls to the
newest message; when newer pages are not loaded yet, it fetches the latest page first.Reaching the bottom marks the newest message read and clears the unread count.
scrollToBottomOnNewMessage: false does not stop a list that is already at the bottom
from following new messages: within five rows of the end, it always scrolls.disableReceipt: true sends no delivery or read receipts.Jumping to a Message
- SwiftUI
- UIKit
goToMessageId scrolls to a message and highlights it — from a search result, say. It is
a binding: the list sets it back to nil when the jump lands, so the same id can be sent
again.Rows
- SwiftUI
- UIKit
Your messages sit on the trailing side, everyone else’s on the leading side, and group
actions and calls are centred. Consecutive messages from one sender are not grouped: each has its own avatar, name and
status line. The one grouping is a batch: with
messageAlignment: .leftAligned draws every message on the
leading side, as incoming.An incoming row shows the sender’s avatar and name in a group — never in a
one-to-one chat, except the avatar in a chat with an AI agent. hideAvatar: true removes
the avatar.The status line under a bubble holds, in order: a pin and a bookmark when the message is
pinned or saved, “edited”, the time, and on your own messages the receipt — a clock while
sending, then sent, delivered and read, or an error when the send failed. There is no retry.
timeStampAlignment: .top moves the time up beside the sender’s name.hideReceipts has no effect: receipts stay. Replace the status line with a
row slot to remove them.enableMultipleAttachments on — the default —
attachments sent together draw as a group, the avatar on the first and the receipt on the
last.Bubbles
Every message kind is drawn by a built-in bubble.- SwiftUI
- UIKit
Each kind is drawn by a bubble factory. The built-ins:
A deleted message of any kind draws the tombstone, “This message was deleted”, and a
kind nothing draws shows “Unsupported: category_type” — never a blank row. The unsupported
text is English in every language.
enableMultipleAttachments: false switches image, video, file and audio messages to the
older single-attachment bubbles, and stops batch grouping.Your Own Bubble
- SwiftUI
- UIKit
A factory names a A factory draws only what it returns. Every other region — avatar, name, quote, status
line, moderation notice, reactions, “N replies” — keeps the list’s default. A factory can
return any of them too, or
MessageKind and draws its content. Register it with
bubbleFactories; it replaces any built-in for the same kind, and the last one registered
wins. Ask the request builder for your type too (see Filtering Messages):bubbleView to replace the whole row:Keep a built-in’s content and change one region by delegating to it:
Bubble Taps
- SwiftUI
- UIKit
To take over a tap, register the built-in factory with its callback — it replaces the
default for that kind:
Join joins the meeting through the Kit’s call coordinator and shows the ongoing-call
screen, reading the session id from the message. To handle it yourself, use
MeetingBubbleFactory(onJoinClick:), or for every list in a subtree
.cometChatMeetingJoinClick(MessageMeetingJoinAction { message, sessionID in … }). The
session id onJoinClick receives is empty for meetings the Kit sent; read it from the
message instead.Reactions
- SwiftUI
- UIKit
Reactions show under the bubble: up to four chips, then a “+N” chip for the rest, and an
add button. A chip shows its count, and is highlighted when you reacted with it. Tapping a
chip toggles your reaction — 
The add button, “+N”, and the add-reaction button in the long-press menu open the
emoji keyboard in a 400 pt sheet. Picking an emoji
adds it — one you have already reacted with is sent again, not removed — and
closes the sheet. From the menu, the menu closes first and the sheet rises after it.
onReactionClick replaces that. The row changes only when
the server confirms.
onAddMoreReactionsClickreplaces the sheet for “+N” and the add button.onEmojiPickerClickreplaces it for the menu’s button. It is called while the menu is still on screen, with the message.
onReactionLongClickreplaces the sheet.reactionsRequestBuilderandreactionListStylereach the sheet — or style it from above the list with.cometChatMessageListReactionListStyle(_:); the parameter wins when set.
hideReactions: true removes the chips. A footerView slot still shows.Replies and Threads
- SwiftUI
- UIKit
A reply carries a quote of the message it answers. Tapping the quote jumps to that
message. Swiping a row toward the trailing edge replies to it, as the Reply option does —
In a thread there is no Reply in thread and no Mark as unread.
swipeToReplyEnabled: false turns that off. There is no swipe on actions, calls, AI
replies, unsent or deleted messages, or in a chat with an AI agent.A message with replies shows “N replies” under it. Tapping it, or choosing Reply in
thread, calls onThreadRepliesClick with the thread’s root. Show the thread in its own
list, with the thread header and the composer as bars
over it — ChatBars from Quick Start:Thread Subscription
The Subscribe to thread option subscribes you to a message’s thread, and turns into Unsubscribe from thread once you are. It needs thread subscriptions on for your app.hideThreadSubscriptionOption removes it.
- SwiftUI
- UIKit
The result shows as a toast:
On a message with no replies yet the two success toasts are shorter. A subscription changed
elsewhere — another list, another device — updates the option.
Pin and Save
Pin, Unpin, Save and Unsave appear only when your app has the pin or save feature turned on. Pin and Save act at once; Unpin and Unsave ask first, in an alert that a tap outside does not dismiss. A toast says how it went.- SwiftUI
- UIKit
The toast reads “Message pinned”, “Message saved”…, the app’s limit — “You can only pin 3
messages. Unpin one to pin another.” — a missing permission, or a generic failure.
The row changes when the server’s update arrives, not when you tap. A pinned or saved
message shows a pin or a bookmark before its time. There is no per-list flag for these
options: they follow your app’s settings. The pinned and saved lists belong to other
screens.

AI
Conversation Starters, Smart Replies and Summary
- SwiftUI
- UIKit
Three optional panels, each off by default:
Smart replies are fetched The panels need the matching AI features enabled for your app. They are off in a chat with
an AI agent, and only the main list — not a thread — fetches them.

smartRepliesDelayDuration milliseconds (10 000 by default) after
an incoming text, and only for a text containing one of smartRepliesKeywords when you set
any. A tap on a starter or a smart reply puts its text in the composer, through the
.composeMessage UI event; onConversationStarterClick and onSmartReplyClick replace
that. Each panel has a style and a view slot — conversationStarterView,
smartRepliesView, conversationSummaryView — that receives its state:Chats With an AI Agent
A user whose role is@agentic is an AI agent.
- SwiftUI
- UIKit
In a chat with one:
- the empty chat shows the agent’s greeting, introduction and suggested messages from its metadata; a tap on a suggestion puts it in the composer;
- the agent’s reply streams in — a thinking shimmer, then text as it arrives, then the finished reply with markdown and cards; a broken stream shows an error;
- there is no long press, no swipe to reply and no reactions;
- the list does not page back;
loadLastAgentConversation: trueopens the latest conversation with the agent instead of the greeting.

hideAiAssistantSuggestedMessages has no effect: the suggestions always show.Message Information
Info, on your own messages, opens message information in a sheet with a medium and a large detent.- SwiftUI
- UIKit
The sheet shows the message as a bubble, then who it reached and who read it. It gets the list’s
The sheet formats mentions itself, so the list hands it no text formatters.
bubbleFactories, onError and its style’s messageInformationStyle; onMessageOptionClick
still fires. hideMessageInfoOption removes the option.Report
Report, on someone else’s message, presents the flag message dialog full screen over the chat, opening and closing without animation. The dialog fetches the app’s flag reasons; the list flags the message when Report is tapped, closes the dialog on success and shows its error line on failure. A tap on the scrim closes it.- SwiftUI
- UIKit
The dialog sits over a 40 % scrim, a Liquid Glass card on iOS 26.
onMessageOptionClick still
fires; hideFlagOption removes the option and hideFlagRemarkInputField the dialog’s remark
field. The list passes no style or texts — style the dialog with the theme and the
cometChatFlagMessage… slot modifiers, which reach it:Actions and Events
Callback Methods
- SwiftUI
- UIKit
onMessagePrivately: the sender is fetched and
dropped.Global Events
- SwiftUI
- UIKit
SDK Events (Real-Time, Automatic)
No wiring required — the list listens to the SDK and to the Kit’s message, group and call events for its chat, and updates itself.Functionality
- SwiftUI
- UIKit
Visibility:
The same elements can be hidden for a whole subtree — it can hide more than a list’s own
flags, never less.
.newMessageIndicator has no parameter:Custom View Slots
Row Slots
- SwiftUI
- UIKit
Every region of every row can be replaced. Each slot is a Every slot is also a modifier, for every list in a subtree. An initialiser argument wins:
MessageRowSlot —
(ChatMessage, MessageAlignment) -> AnyView:A slot outranks a factory’s region, which outranks the list’s default.
With
messageAlignment: .leftAligned, a slot is told the sender’s alignment —
.outgoing for your own messages — although the row is drawn on the leading side.State and List Views
- SwiftUI
- UIKit
.cometChatMessageListEmptyView { … } and so on.Formatting
- SwiftUI
- UIKit
Mentions
A tap on a user mention in a text message opens that user’s chat: the list raises theopenChat UI event with that user. Push the chat where your app navigates:
- SwiftUI
- UIKit
TextBubbleFactory(onMentionClick:) you register still gets the tap, first. Mention-all opens
nothing.Mentions are drawn by a mentions formatter. With textFormatters: nil, the default, the
list makes one — disableMentionAll turns off mention-all, and mentionAllLabelId with
mentionAllLabel rename it:Copy and Share put out the raw text — a mention stays
<@uid:…> — unless you pass
textFormatters.Menu Options
A long press on a message opens its menu: a bar of quick reactions and the options. Up to six options show at once; with more, a seventh row, More, expands the rest in place — it stays as the header of the same card, and tapping it again folds them back.- SwiftUI
- UIKit
The quick-reactions bar sits above the message, and the options below it.
There is no long press on group actions, calls, or an AI agent’s replies, nor on a message
that is still sending or was deleted. In a chat with an AI agent there is none at all.

- SwiftUI
- UIKit
Each option keeps its rules:Every chosen option ends at
A message the moderator disapproved keeps only Copy, Delete and Translate, and has no quick
reactions.
Delete asks first, in a system alert. The row changes only when the server confirms; a
failed delete changes nothing and reports nothing. Translate draws the translation under
the message’s text, below a separator, with a “Translated message” caption.
onMessageOptionClick, after the built-in handling, with the
option’s id and title:Hiding Options
- SwiftUI
- UIKit
Each built-in has a flag:
hideReplyOption, hideReplyInThreadOption,
hideThreadSubscriptionOption, hideCopyMessageOption, hideEditMessageOption,
hideDeleteMessageOption, hideShareMessageOption, hideTranslateMessageOption,
hideMarkAsUnreadOption, hideMessageInfoOption, hideFlagOption (Report),
hideMessagePrivatelyOption, and hideMessageReactionOption (the quick reactions).hideReplyOption also hides an option of yours with the id reply_to_message.
hideFlagRemarkInputField hides the report dialog’s remark field.Your Own Options
- SwiftUI
- UIKit
addOptions appends options after the built-ins. options replaces the menu when it
returns non-nil, and then addOptions is not asked. Neither is filtered by the hide flags.
An option with its own onClick runs that instead of the list’s handling, and does not
reach onMessageOptionClick:optionsPolicy:Quick Reactions
- SwiftUI
- UIKit
The bar shows
quickReactions — 👍 ❤️ 😂 😮 😢 🙏 by default. A tap adds that reaction;
onQuickReactionClick replaces that. Tapping a reaction you already gave adds it again
rather than removing it. An empty list shows the popup’s own five.Advanced Methods
Store Access
- SwiftUI
- UIKit
Every list has a
MessageListStore. Pass your own to share it, or to render fixed state
with no session — a seeded store fetches, listens and sends nothing:MessageListPolicy holds the list’s rules:The behaviour flags —
disableReceipt, startFromUnreadMessages,
unreadMessageThreshold, the sound flags, the AI flags and loadLastAgentConversation
— reach the store only when the user, group or goToMessageId changes. Changing one on
a list already showing that chat has no effect.Subclassing
- SwiftUI
- UIKit
CometChatMessageList is a View struct. Customise it with its parameters, slots, modifiers,
store and policies.Objective-C
In the UIKit toolkit: The list is@objc. Fluent setters take Swift’s set(user:) as setWithUser::
CometChatMessageTemplate is a class, so Objective-C can build one. Swift only:
store / set(store:), quickReactions, dateTimeFormatter, set(textFormatters:), the three
pattern setters, and the four state-copy properties (emptyTitleText, emptySubtitleText,
errorTitleText, errorSubtitleText).
Style
- SwiftUI
- UIKit
CometChatMessageListStyle is sparse: set only what you change, and everything else
follows the theme.Each
MessageBubbleStyle also carries a content style per kind: textBubbleStyle,
imageBubbleStyle, videoBubbleStyle, fileBubbleStyle, audioBubbleStyle (the voice
note), audiosBubbleStyle, meetCallBubbleStyle, pollBubbleStyle,
collaborativeBubbleStyle, deleteBubbleStyle and, on actionBubbleStyle,
callActionBubbleStyle. A factory’s own style(for:) wins over the list’s.aiAssistantBubbleStyle and moderationViewStyle exist but are not applied: AI replies
take the incoming style, and the moderation notice its fixed colours.Next Steps
Message Composer
The input the list’s Edit, Reply and smart replies fill
Message Header
The bar above the list
Events
What the list listens to and announces
Theming
The tokens every bubble’s default comes from
