> ## Documentation Index
> Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Message Information

> One of your messages as a bubble, with who it was delivered to and who read it.

`CometChatMessageInformation` shows one of your messages as a bubble at the top, and its
delivery and read receipts below. In a one-to-one chat that is one Read and one Delivered
line, dated from the message itself. In a group it is one row per member, as the server
returns them, updated live while the sheet is open.

![CometChatMessageInformation showing a message and each member's read and delivered times](https://mintcdn.com/cometchat-22654f5b/pWDsskjSUHgot30F/images/ui-kit/ios/v6/docs-overview-message-information.png?fit=max\&auto=format\&n=pWDsskjSUHgot30F\&q=85\&s=9b2d2466d35c7dff39f1fe4ff367775b)

***

## Where It Fits

```
your own message ── "Info" ──▶ ┌───────────────────────────────────┐
                               │ CometChatMessageInformation ← here │  a sheet, .medium / .large
                               │   the bubble                       │
                               │   Read · Delivered, per member     │
                               └───────────────────────────────────┘
```

It only makes sense for messages you sent: receipts are the sender's. There is no "Sent" row
and no sorting — the rows come in the order the server returns them.

### From the Message List

> [tab] SwiftUI
>
> The [message list](https://www.cometchat.com/docs/ui-kit/ios/v6/message-list.md#message-information)'s **Info** option opens
> this sheet for your own messages, with the list's `bubbleFactories`, `onError` and its style's
> `messageInformationStyle`. It passes no text formatters; the sheet makes its own mentions
> formatter.

> [tab] UIKit
>
> The [message list](https://www.cometchat.com/docs/ui-kit/ios/v6/message-list.md#message-information)'s **Info** option presents
> this screen for your own messages, as below, with the list's templates, text formatters and
> `dateTimeFormatter`, its error forwarding, and its `messageInformationConfiguration` applied.

***

## Quick Start

> [tab] SwiftUI
>
> The sheet carries its own detents and drag indicator, so any `.sheet` shows it correctly:
>
> ```swift theme={null}
> struct ChatScreen: View {
>     @State private var showsInfo = false
>
>     var body: some View {
>         Button("Info") { showsInfo = true }
>             .sheet(isPresented: $showsInfo) {
>                 CometChatMessageInformation(message: sentMessage, onError: { report($0) })
>             }
>     }
> }
> ```
>
> There is no close button: the sheet is swiped away, and `onDismiss` is called when it goes.

> [tab] UIKit
>
> `CometChatMessageInformation` is a view controller. Put it in a navigation controller and
> present it as a sheet:
>
> ```swift theme={null}
> @MainActor func showInfo(for message: BaseMessage, from host: UIViewController) {
>     let info = CometChatMessageInformation()
>     info.set(message: message)
>     let nav = UINavigationController(rootViewController: info)
>     nav.sheetPresentationController?.detents = [.medium(), .large()]
>     nav.sheetPresentationController?.prefersGrabberVisible = true
>     host.present(nav, animated: true)
> }
> ```
>
> There is no back or close button: the sheet is swiped away.

***

## What It Shows

> [tab] SwiftUI
>
> | Chat | State | Below the bubble |
> | - | - | - |
> | any | loading | thirty shimmer rows |
> | one-to-one | delivered or read | **Read** and **Delivered**, each with its date if it has one |
> | one-to-one | never delivered | **Read** and **Delivered** with no dates |
> | group | receipts | one row per member: the name, "Read" if they read it, "Delivered" if it reached them, each with its own date |
> | group | none, or an error | nothing |
>
> Dates read `dd/M/yyyy, h:mm a`. A member who has neither read nor received the message shows
> their name alone.

> [tab] UIKit
>
> | Chat | State | Below the bubble |
> | - | - | - |
> | any | loading | thirty shimmer rows |
> | one-to-one | delivered or read | a **Read** and a **Delivered** row, each with its date if it has one |
> | one-to-one | never delivered | both rows, no dates |
> | group | receipts | one row per member: avatar, name, "Read" if they read it and "Delivered" if it reached them, each with its own date |
> | group | none, or an error | nothing — or your `set(emptyView:)` / `set(errorView:)` |
>
> Dates read `dd/M/yyyy, h:mm a` unless `dateTimeFormatter` answers first. A member who has
> neither read nor received the message shows their name alone.

> [!NOTE]
>
> The bubble is drawn as the message list draws it — always as an outgoing message, with no
> avatar and no "N replies" line — and does not respond to touches.

***

## Actions and Events

### Callback Methods

> [tab] SwiftUI
>
> | Prop | Signature | When |
> | - | - | - |
> | `onDismiss` | `() -> Void` | the sheet goes |
> | `onError` | `(CometChatError) -> Void` | any error, including one an injected store already holds |

> [tab] UIKit
>
> ```swift theme={null}
> info.setOnError { error in log(error) }
> info.delegate = errorHandler   // a CometChatMessageInformationDelegate
> info.set(emptyView: MyEmptyView())
> info.set(errorView: MyErrorView())
> ```
>
> `setOnError` and the delegate (`CometChatMessageInformationDelegate`) are both called. The
> screen shows nothing in the empty and error states; install your own text through
> `set(emptyView:)` and `set(errorView:)`. There is no `onDismiss`.

### SDK Events (Real-Time, Automatic)

> [tab] SwiftUI
>
> While the sheet is open, a group member's new receipt updates their row, and a member not yet
> listed appears at the top. The one-to-one lines are read from the message, so a read that
> arrives while the sheet is open shows the next time it opens.

> [tab] UIKit
>
> While the screen is open, a group member's new receipt updates their row. A one-to-one row
> does not update while the screen is open.

***

## Functionality

> [tab] SwiftUI
>
> | Prop | Type | Default |
> | - | - | - |
> | `message` | `BaseMessage` | required |
> | `store` | `CometChatMessageInformationStore?` | `nil` |
> | `style` | `CometChatMessageInformationStyle` | |
> | `toolBarTitleText` | `String?` | "Message Info" |
> | `hideToolBar` | `Bool` | `false` |
> | `bubbleFactories` | `[any BubbleFactory]` | `[]` |
> | `textFormatters` | `[any CometChatTextFormatter]?` | one mentions formatter |
> | `imageSource` | `any ImageSource` | `CometChatSharedImageSource()` |
>
> The title:
>
> ```swift theme={null}
> CometChatMessageInformation(message: sentMessage, toolBarTitleText: "Delivery")
> CometChatMessageInformation(message: sentMessage, hideToolBar: true)
> ```
>
> The sheet applies `.presentationDetents([.medium, .large])` and the drag indicator itself.

> [tab] UIKit
>
> | Method or property | Type | Does |
> | - | - | - |
> | `set(message:)` | `BaseMessage` | the message to inspect |
> | `set(store:)` | `CometChatMessageInformationStore` | the store the screen reads |
> | `title`, `hideNavigationBar` | | the title, and whether the navigation bar shows |
> | `set(templates:)`, `add(template:)` | `[CometChatMessageTemplate]`, `CometChatMessageTemplate` | the bubble's templates |
> | `set(textFormatters:)` | `[CometChatTextFormatter]` | text formatters for the bubble |
> | `dateTimeFormatter` | `CometChatDateTimeFormatter?` | formats the dates before the default pattern |
> | `style`, `receiptStyle`, `avatarStyle` | `MessageInformationStyle`, `ReceiptStyle`, `AvatarStyle` | the screen's styles |
>
> The host owns the sheet: a navigation controller and its detents.

***

## Custom View Slots

> [tab] SwiftUI
>
> `bubbleFactories` render the message as your list does. `bubbleView` replaces the bubble inside
> its container:
>
> ```swift theme={null}
> CometChatMessageInformation(
>     message: sentMessage,
>     bubbleView: { message in AnyView(MyInspectedBubble(message: message)) }
> )
> ```
>
> Or for every message-information sheet in a subtree. An initialiser argument wins:
>
> ```swift theme={null}
> MyAppRoot()
>     .cometChatMessageInformationBubbleView { message in Text(message.text ?? "") }
> ```
>
> `textFormatters` format the bubble's text. Leave it `nil` and the sheet uses one mentions
> formatter, so a mention reads as a name.
>
> | Slot | Replaces | Modifier |
> | - | - | - |
> | `bubbleView` | the bubble | `.cometChatMessageInformationBubbleView` |

> [tab] UIKit
>
> The bubble is drawn through your templates, as the message list draws it. Set templates and
> formatters **before** `set(message:)`; a later change shows on the next `set(message:)`:
>
> ```swift theme={null}
> let info = CometChatMessageInformation()
>     .set(templates: [])
>     .set(textFormatters: [CometChatMentionsFormatter()])
>     .set(message: sentMessage)
> ```
>
> Or replace it — your view becomes the table header as it is:
>
> ```swift theme={null}
> info.setBubbleView { message in MyInspectedBubbleView(message: message) }
> ```
>
> Rows:
>
> ```swift theme={null}
> info.setListItemView { message, receipt in
>     MyReceiptRowView(receipt: receipt)
> }
> info.dateTimeFormatter = MyDateFormatter()
> info.listItemCellClass = MyReceiptCell.self
> ```
>
> `MessageInformationReceiptCell` is `open`: override `configure(receipt:message:style:receiptStyle:dateText:)`
> or `configureUserRow(kind:date:style:receiptStyle:dateText:)`.
>
> Replace the empty and error states with `set(emptyView:)` and `set(errorView:)`, and the
> loading state with `set(loadingView:)`.

***

## Advanced Methods

### Store Access

> [tab] SwiftUI
>
> `CometChatMessageInformationStore` holds the receipts and listens for new ones. Pass a seeded
> store to show fixed receipts in a preview — a seeded store never fetches or listens:
>
> ```swift theme={null}
> #Preview {
>     CometChatMessageInformation(
>         message: sentMessage,
>         store: CometChatMessageInformationStore(seeded: .loaded, receipts: ChatReceipt.sampleGroupMixed,
>                                                 kind: .group))
> }
> ```
>
> > [!WARNING]
> >
> > A store remembers its last error. Reuse one for another sheet and `onError` reports that
> > error again when the sheet appears.

> [tab] UIKit
>
> `set(store:)` replaces the store the screen reads.

### Configuration

> [tab] SwiftUI
>
> Pass the title, style and slots as arguments: see Functionality.

> [tab] UIKit
>
> `MessageInformationConfiguration` hands a set of values to a screen; `apply(to:)` sets them:
>
> ```swift theme={null}
> let config = MessageInformationConfiguration()
>     .set(titleText: "Delivery")
>     .set(emptyStateText: "Waiting for recipients")
> config.apply(to: info)
> ```
>
> `set(backIcon:)`, `set(loadingIcon:)` and `setOnBack(onBack:)` are accepted and do nothing.

### Subclassing

> [tab] SwiftUI
>
> `CometChatMessageInformation` is a `View` struct. Customise it with its bubble slot, factories and style.

> [tab] UIKit
>
> These methods are `open`: `defaultSetup()`, `registerCells()`, `setupStyle()`,
> `styleNavigationBar()`, `buildBubbleView()`, `showEmptyView()`, `showErrorView()`,
> `showLoadingView()`, `renderCurrentState()` and `reloadData()`.
>
> ```swift theme={null}
> final class MyInfoScreen: CometChatMessageInformation {
>     override func setupStyle() {
>         super.setupStyle()
>         view.tintColor = .systemOrange
>     }
>     override func showEmptyView() {
>         super.showEmptyView()
>         title = "No receipts yet"
>     }
> }
> ```

***

## Accessibility

* A member's row reads as their name, then "Read *date*, Delivered *date*".
* The one-to-one lines read "Message read" and "Message delivered", then the date.
* The bubble is read, not tapped; with the toolbar hidden it is the sheet's heading.

***

## Style

> [tab] SwiftUI
>
> `CometChatMessageInformationStyle` is sparse: set only what you change.
>
> | Property | Default |
> | - | - |
> | `backgroundColor` | the system sheet on Liquid Glass, `background1` otherwise |
> | `backgroundHighlightColor` | `background2` — behind the bubble |
> | `cornerRadius` | the system's sheet corner |
> | `titleTextStyle`, `titleTextColor` | the system's inline title |
> | `itemNameTextStyle`, `itemNameTextColor` | `heading4Medium`, `textPrimary` |
> | `itemReadTextStyle`, `itemReadTextColor` | `bodyRegular`, `textSecondary` (`textPrimary` on the one-to-one title) |
> | `itemReadDateTextStyle`, `itemReadDateTextColor` | `bodyRegular`, `textSecondary` |
> | `itemDeliveredTextStyle`, `itemDeliveredTextColor` | as Read |
> | `itemDeliveredDateTextStyle`, `itemDeliveredDateTextColor` | as Read |
> | `itemAvatarStyle` | 40 pt, `extendedPrimary500` |
> | `messageReceiptStyle` | read tick `info`, delivered tick `iconTintSecondary` |
>
> ```swift theme={null}
> var style = CometChatMessageInformationStyle()
> style.backgroundHighlightColor = .yellow
> style.itemNameTextColor = .indigo
> style.messageReceiptStyle = ReceiptStyle(readTint: .green)
>
> CometChatMessageInformation(message: sentMessage, style: style)
> ```
>
> > [!NOTE]
> >
> > `strokeWidth` and `strokeColor` are accepted and change nothing: the system grabber cannot
> > be styled.

> [tab] UIKit
>
> ```swift theme={null}
> let style = MessageInformationStyle()
> style.bubbleContainerBackgroundColor = .systemYellow
> style.listItemTitleTextColor = .systemIndigo
> style.listItemSubTitleFont = .systemFont(ofSize: 13)
> CometChatMessageInformation.style = style           // every new screen
> info.style = style.copyStyle()                      // this one
> info.receiptStyle.readImageTintColor = .systemGreen
> ```
>
> Unset colours and fonts follow the theme. `largeTitleColor`, `largeTitleFont`,
> `navigationBarItemsTintColor`, `tableViewSeparator` and the five `listItemSelect…` fields have
> no effect. Border width and colour are applied.

***

## Next Steps

> [card] [Message List](https://www.cometchat.com/docs/ui-kit/ios/v6/message-list.md)
>
> Opens this screen from a message's Info option

> [card] [Reaction List](https://www.cometchat.com/docs/ui-kit/ios/v6/reaction-list.md)
>
> Who reacted to a message

> [card] [Message Template](https://www.cometchat.com/docs/ui-kit/ios/v6/message-template.md)
>
> Customise how a message's bubble is drawn

> [card] [Component Styling](https://www.cometchat.com/docs/ui-kit/ios/v6/component-styling.md)
>
> Style every component


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.