Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
f231279
docs(ios): restructure pin/save/threads and drop the fictional enable…
shreeyajoshi-cometchat Sep 10, 2026
cd990e9
docs(ios): document the thread-subscription opt-out
shreeyajoshi-cometchat Sep 10, 2026
c599db6
docs(ios): put the thread-subscription bell in the navigation bar
shreeyajoshi-cometchat Sep 11, 2026
c2722fd
docs(ios): document pin conversations on the conversations page
shreeyajoshi-cometchat Sep 11, 2026
84c9e7d
docs(ios-uikit): fold thread subscription into the threaded-messages …
shreeyajoshi-cometchat Sep 14, 2026
6cfb9ce
docs(ios-uikit): document only the per-surface thread-subscription co…
shreeyajoshi-cometchat Sep 14, 2026
6f04901
docs(ios): correct the hideThreadSubscriptionOption wiring
shreeyajoshi-cometchat Sep 15, 2026
d3c206c
docs(ios): document the per-surface thread-subscription opt-outs
shreeyajoshi-cometchat Sep 15, 2026
e6bfe27
docs(ios): fix the thread-subscription anchor and option references
shreeyajoshi-cometchat Sep 15, 2026
06b3f37
docs(ios): add the Pinned and Saved Messages screenshots
shreeyajoshi-cometchat Sep 15, 2026
4a205d4
docs(ui-kit/ios): document rich-text toolbar trailing buttons
shreeyajoshi-cometchat Sep 15, 2026
1f00fc6
docs(ui-kit/ios): document textColorKey, the marker that makes colour…
shreeyajoshi-cometchat Sep 15, 2026
9beb518
docs(ui-kit/ios): correct the trailing-action mutator parameter name
shreeyajoshi-cometchat Sep 15, 2026
14d3f1d
docs(ios): combine the composer trailing-button page into the pin/sav…
shreeyajoshi-cometchat Sep 18, 2026
5e858c4
docs(ui-kit/ios): correct the composer colour model to formatter-owne…
shreeyajoshi-cometchat Sep 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -1533,7 +1533,6 @@
"pages": [
"ui-kit/ios/guide-overview",
"ui-kit/ios/guide-threaded-messages",
"ui-kit/ios/guide-thread-subscription",
"ui-kit/ios/guide-pin-save-message",
"ui-kit/ios/guide-block-unblock-user",
"ui-kit/ios/guide-new-chat",
Expand Down Expand Up @@ -6961,6 +6960,10 @@
}
},
"redirects": [
{
"source": "/ui-kit/ios/guide-thread-subscription",
"destination": "/ui-kit/ios/guide-threaded-messages#thread-subscription"
},
{
"source": "/sdk/flutter/group-kick-member",
"destination": "/sdk/flutter/group-kick-ban-members"
Expand Down
Binary file added images/ios-pin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ios-save.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
145 changes: 145 additions & 0 deletions ui-kit/ios/compact-message-composer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<Tabs>
<Tab title="Swift">
```swift
let compactComposer = CometChatCompactMessageComposer()

Check warning on line 21 in ui-kit/ios/compact-message-composer.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/compact-message-composer.mdx#L21

Did you really mean 'compactComposer'?
compactComposer.set(user: user)
compactComposer.set(controller: self)
compactComposer.translatesAutoresizingMaskIntoConstraints = false
Expand Down Expand Up @@ -143,13 +143,13 @@
<Tabs>
<Tab title="Swift">
```swift
var customStyle = CompactMessageComposerStyle()

Check warning on line 146 in ui-kit/ios/compact-message-composer.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/compact-message-composer.mdx#L146

Did you really mean 'customStyle'?
customStyle.activeSendButtonBackgroundColor = UIColor(hex: "#F76808")

Check warning on line 147 in ui-kit/ios/compact-message-composer.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/compact-message-composer.mdx#L147

Did you really mean 'customStyle'?
customStyle.attachmentImageTint = UIColor(hex: "#F76808")
customStyle.voiceRecordingImageTint = UIColor(hex: "#F76808")
customStyle.stickersImageTint = UIColor(hex: "#F76808")

let compactComposer = CometChatCompactMessageComposer()

Check warning on line 152 in ui-kit/ios/compact-message-composer.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/compact-message-composer.mdx#L152

Did you really mean 'compactComposer'?
compactComposer.style = customStyle
```
</Tab>
Expand Down Expand Up @@ -340,10 +340,10 @@

| Property | Description | Code |
| -------- | ----------- | ---- |
| backgroundColor | Background color of the toolbar. | `toolbarStyle.backgroundColor = CometChatTheme.backgroundColor02` |

Check warning on line 343 in ui-kit/ios/compact-message-composer.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/compact-message-composer.mdx#L343

Did you really mean 'backgroundColor'?
| borderColor | Border color of the toolbar. | `toolbarStyle.borderColor = CometChatTheme.borderColorLight` |

Check warning on line 344 in ui-kit/ios/compact-message-composer.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/compact-message-composer.mdx#L344

Did you really mean 'borderColor'?
| buttonSize | Size of format buttons. | `toolbarStyle.buttonSize = 30` |

Check warning on line 345 in ui-kit/ios/compact-message-composer.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/compact-message-composer.mdx#L345

Did you really mean 'buttonSize'?
| buttonSpacing | Spacing between format buttons. | `toolbarStyle.buttonSpacing = CometChatSpacing.Spacing.s2` |

Check warning on line 346 in ui-kit/ios/compact-message-composer.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/compact-message-composer.mdx#L346

Did you really mean 'buttonSpacing'?
| iconTintColor | Tint color for inactive format icons. | `toolbarStyle.iconTintColor = CometChatTheme.iconColorSecondary` |
| activeIconTintColor | Tint color for active format icons. | `toolbarStyle.activeIconTintColor = CometChatTheme.primaryColor` |
| buttonBackgroundColor | Background color for inactive buttons. | `toolbarStyle.buttonBackgroundColor = .clear` |
Expand All @@ -351,13 +351,158 @@

---

### Trailing toolbar actions

`set(richTextToolbarActions:)` appends your own buttons at the trailing end of the built-in toolbar — after the format buttons, separated by a divider — without replacing the toolbar. It takes the same closure shape as `set(attachmentOptions:)`, receiving the current `User?` and `Group?`, and returns a list of `CometChatRichTextToolbarAction` items.

| Property | Type | Description |
| -------- | ---- | ----------- |
| `id` | `String` | Identifies the action, and looks the rendered button up in `CometChatRichTextToolbar.trailingActionButtons`. |
| `icon` | `UIImage?` | The button glyph. Rendered as-is — apply `.withRenderingMode(.alwaysTemplate)` for `tint` or the toolbar's `iconTintColor` to take effect. |
| `onClick` | `(CometChatComposerInput) -> Void` | Called on tap with a live handle onto the composer's input. |
| `tint` | `UIColor?` | Overrides `RichTextToolbarStyle.iconTintColor` when non-nil. |
| `accessibilityLabel` | `String?` | VoiceOver label. Falls back to `id`, so a button is never unlabelled. |

Each action's `onClick` receives a **`CometChatComposerInput`** — a live handle for reading and mutating the draft, so the composer stays the owner of the field:

| Member | Description |
| ------ | ----------- |
| `text: String` | The input's contents without attributes. |
| `attributedText: NSAttributedString` | The contents, including formatting attributes. |
| `selectedRange: NSRange` | The current selection, or a zero-length range at the caret. |
| `hasSelection: Bool` | Whether text is selected, as opposed to a caret being placed. |
| `typingAttributes: [NSAttributedString.Key: Any]` | Attributes the next typed character inherits — set this to format text typed next rather than a selection. |
| `mentionRanges: [NSRange]` | The ranges currently occupied by mentions. |
| `attributes(at:)` | The attributes at a location, or empty if out of bounds. |
| `insertAtCaret(_:)` | Insert at the caret, replacing any selection; the caret lands after the inserted text. |
| `setAttributedText(_:preservingSelection:)` | Replace the contents, keeping the selection by default. |
| `setSelectedRange(_:)` | Move the caret or change the selection, clamped to the current length. |
| `applyAttributes(_:to:protectingKitRuns:)` / `removeAttributes(_:from:protectingKitRuns:)` | Add or strip attributes over a range. |
| `applyAttributesToSelection(_:protectingKitRuns:)` / `removeAttributesFromSelection(_:protectingKitRuns:)` | The same over the current selection; each returns whether there was a selection to act on. |
| `commit()` | Resync the toolbar and send button partway through a long edit. |

Check warning on line 382 in ui-kit/ios/compact-message-composer.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/compact-message-composer.mdx#L382

Did you really mean 'Resync'?

<Tabs>
<Tab title="Swift">
```swift
compactComposer.set(richTextToolbarActions: { user, group in
[
CometChatRichTextToolbarAction(
id: "insert_greeting",
icon: UIImage(systemName: "hand.wave")?.withRenderingMode(.alwaysTemplate),
accessibilityLabel: "Greeting"

Check warning on line 392 in ui-kit/ios/compact-message-composer.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/compact-message-composer.mdx#L392

Did you really mean 'accessibilityLabel'?
) { input in
input.insertAtCaret(NSAttributedString(string: "Hello! "))
}
]
})
```
</Tab>
</Tabs>

Actions are registered per composer instance, so a thread composer can offer a different set from the main one.

<Note>

The trailing section lives **inside** the rich-text toolbar — it is not rendered when the toolbar is hidden (`showRichTextFormattingOptions = false`) or rich text is disabled (`enableRichTextFormatting = false`).

The `CometChatComposerInput` is valid only for the duration of the `onClick` call; don't retain it. The action itself is retained by the toolbar, so capture `self` weakly.

The composer serializes to markdown on send. The built-in formats survive. Every other attribute you apply is composer-local: markdown has no representation for it, so it is dropped from the sent message. Use attributes for affordances that are meant to be transient, such as marking a range while the action's own picker or sheet is open — and to send styling of your own, insert text your formatter understands. See [Sending styling of your own](#sending-styling-of-your-own).

Check warning on line 410 in ui-kit/ios/compact-message-composer.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/compact-message-composer.mdx#L410

Did you really mean 'affordances'?

</Note>

Mutations apply immediately, but composer state that derives from the text — the toolbar's active formats and the send button — resyncs once when `onClick` returns rather than per mutation, so a multi-step edit resyncs once. Call `commit()` to resync earlier.

Check warning on line 414 in ui-kit/ios/compact-message-composer.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/compact-message-composer.mdx#L414

Did you really mean 'resyncs'?

Check warning on line 414 in ui-kit/ios/compact-message-composer.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/compact-message-composer.mdx#L414

Did you really mean 'resyncs'?

Check warning on line 414 in ui-kit/ios/compact-message-composer.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/compact-message-composer.mdx#L414

Did you really mean 'resync'?

#### Leaving Kit-owned runs alone

An action that restyles a range will happily run over a mention or a link, which the Kit repaints on its own schedule — so your attribute is reverted on the next repaint anyway, and removing one of the Kit's attributes deletes it rather than restoring the Kit's value.

The mutating methods therefore take `protectingKitRuns`, which defaults to `true`. With it on, **mention ranges** are carved out of the target range and left untouched; the mutation is applied to the gaps between them.

<Warning>

`protectingKitRuns` protects mentions, and only mentions. Links, inline code, code blocks and every other run the Kit repaints are **yours to skip** — the Kit leaves that decision to you, as the Android and Compose Kits do.

If your action restyles a range that spans a link or a code block, do the check yourself before mutating.

</Warning>

To make that decision, read `mentionRanges` for mentions and `attributes(at:)` for everything else — inspect the run's own attributes (`.link`, the monospaced font, and so on) and narrow your range accordingly. Ranges are read at call time, so re-read them after a mutation rather than caching, as they shift with the text.

Check warning on line 430 in ui-kit/ios/compact-message-composer.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/compact-message-composer.mdx#L430

Did you really mean 'monospaced'?

Pass `protectingKitRuns: false` to opt out and write over the whole range in one go.

Two behaviours worth knowing before you write an action:

- `applyAttributes` is **additive**. It adds your keys and leaves existing ones in place, so a colour applied over bold text keeps the bold.
- `removeAttributes` **strips keys rather than resetting values**. The text falls back to the input's own styling, not to a value you choose. To reset to something specific, call `applyAttributes` with it.

<Tabs>
<Tab title="Swift">
```swift
CometChatRichTextToolbarAction(
id: "highlight",
icon: UIImage(systemName: "highlighter")?.withRenderingMode(.alwaysTemplate),
accessibilityLabel: "Highlight"
) { input in
// Highlighting applies to a selection; with only a caret there is nothing
// to restyle, so leave the text alone rather than guessing at a range.
guard input.hasSelection else { return }

// Mentions are skipped by default. This is composer-local: it marks the
// range on screen and is dropped on send.
input.applyAttributesToSelection([
.backgroundColor: UIColor.systemYellow.withAlphaComponent(0.3)
])
}
```
</Tab>
</Tabs>

#### Sending styling of your own

Attributes are composer-local, so styling that has to reach the recipient travels as **text**, not as an `NSAttributedString` attribute. Your action inserts a token the message carries, and a `CometChatTextFormatter` — see [setTextFormatters](#settextformatters) below, and the [Mentions formatter guide](/ui-kit/ios/mentions-formatter-guide) for a worked subclass — renders that token in the bubble. The token and its rendering are both yours — the Kit carries the characters and stays out of the way.

The documented convention for text colour is `{color:#hex}…{/color}`:

<Tabs>
<Tab title="Swift">
```swift
CometChatRichTextToolbarAction(
id: "red_text",
icon: UIImage(systemName: "paintpalette")?.withRenderingMode(.alwaysTemplate),
accessibilityLabel: "Red text"
) { input in
guard input.hasSelection else { return }

// Wrap the selection in a token your formatter understands. This is
// ordinary text, so it survives send.
input.replaceSelection("{color:#ff0000}\(input.selectedText){/color}")
}
```
</Tab>
</Tabs>

`replaceSelection(_:)` degrades to an insertion when only a caret is placed, and leaves the caret after the inserted text.

<Note>

Pair the button with a formatter that renders the token, on **every** platform your users are on. Without one the recipient sees the literal `{color:#ff0000}…{/color}` braces in the message.

Because the token is plain text, a user can also type it by hand, and it will render the same way. Choose a delimiter you are comfortable having interpreted anywhere it appears.

</Note>

The UI Kit ships no colour button of its own, and no colour parsing: the composer handle and the formatter API are provided, the token and its rendering are yours. That is what the trailing-actions slot is for.

---

## Advanced

For advanced-level customization, you can set custom views to the component. This lets you tailor each aspect of the component to fit your exact needs and application aesthetics. You can create and define your views, layouts, and UI elements and then incorporate those into the component.

### setTextFormatters

Assigns the list of text formatters. If the provided list is not null, it sets the list. Otherwise, it assigns the default text formatters retrieved from the data source. To configure the existing Mentions look and feel check out [CometChatMentionsFormatter](/ui-kit/ios/mentions-formatter-guide)

Check warning on line 505 in ui-kit/ios/compact-message-composer.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/compact-message-composer.mdx#L505

Did you really mean 'formatters'?

Check warning on line 505 in ui-kit/ios/compact-message-composer.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/compact-message-composer.mdx#L505

Did you really mean 'formatters'?

**Example**

Expand All @@ -373,7 +518,7 @@

let customMentionFormatter = CometChatMentionsFormatter()
.set(composerTextStyle: composerTextStyle)

Check warning on line 521 in ui-kit/ios/compact-message-composer.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/compact-message-composer.mdx#L521

Did you really mean 'compactComposer'?
let compactComposer = CometChatCompactMessageComposer()
compactComposer.set(textFormatter: [customMentionFormatter])
```
Expand Down Expand Up @@ -402,7 +547,7 @@

<Tabs>
<Tab title="Swift">
```swift

Check warning on line 550 in ui-kit/ios/compact-message-composer.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/compact-message-composer.mdx#L550

Did you really mean 'compactComposer'?
let compactComposer = CometChatCompactMessageComposer()

compactComposer.set(attachmentOptions: { user, group, controller in
Expand Down Expand Up @@ -455,7 +600,7 @@
<Tabs>
<Tab title="Swift">
```swift
compactComposer.reply(message: baseMessage)

Check warning on line 603 in ui-kit/ios/compact-message-composer.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/compact-message-composer.mdx#L603

Did you really mean 'baseMessage'?
```
</Tab>
</Tabs>
Expand All @@ -465,9 +610,9 @@
<Tabs>
<Tab title="Swift">
```swift
compactComposer.preview(message: baseMessage, mode: .edit)

Check warning on line 613 in ui-kit/ios/compact-message-composer.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/compact-message-composer.mdx#L613

Did you really mean 'baseMessage'?
// or
compactComposer.preview(message: baseMessage, mode: .reply)

Check warning on line 615 in ui-kit/ios/compact-message-composer.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/compact-message-composer.mdx#L615

Did you really mean 'baseMessage'?
```
</Tab>
</Tabs>
Expand Down
88 changes: 88 additions & 0 deletions ui-kit/ios/conversations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
"callbacks": {
"onItemClick": "(Conversation, IndexPath) -> Void",
"onItemLongClick": "(Conversation, IndexPath) -> Void",
"onBack": "() -> Void",

Check warning on line 35 in ui-kit/ios/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/conversations.mdx#L35

Did you really mean 'onBack'?
"onSelection": "([Conversation]) -> Void",

Check warning on line 36 in ui-kit/ios/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/conversations.mdx#L36

Did you really mean 'onSelection'?
"onError": "(CometChatException) -> Void",

Check warning on line 37 in ui-kit/ios/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/conversations.mdx#L37

Did you really mean 'onError'?
"onEmpty": "() -> Void",

Check warning on line 38 in ui-kit/ios/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/conversations.mdx#L38

Did you really mean 'onEmpty'?
"onLoad": "([Conversation]) -> Void"

Check warning on line 39 in ui-kit/ios/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/conversations.mdx#L39

Did you really mean 'onLoad'?
},
"visibility": {
"hideSearch": { "type": "Bool", "default": false },
Expand All @@ -52,7 +52,7 @@
"customSoundForMessages": { "type": "URL?", "default": "nil" }
},
"selection": {
"selectionMode": { "type": "SelectionMode", "default": ".none" }

Check warning on line 55 in ui-kit/ios/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/conversations.mdx#L55

Did you really mean 'selectionMode'?
},
"viewSlots": {
"listItemView": "(Conversation) -> UIView",
Expand Down Expand Up @@ -398,15 +398,67 @@

---

## Pinning Conversations

*Available since v5.1.22*

A pinned conversation sits at the top of the list with a pin indicator on the row, and holds that position as new messages arrive in other chats. A personal pin is **private to the logged-in user** — nobody else sees it — and syncs to that user's other devices.

<Warning>
**Two gates, both required.** Pin Conversation needs the `features.ux.conversations.pinned.enabled` app setting mapped for your app, *and* your own opt-in via `enablePinConversation`. With either missing the swipe action never appears. The kit reads the app setting through `CometChat.isPinConversationEnabled()`.
</Warning>

```swift lines
import CometChatUIKitSwift

let conversations = CometChatConversations()
conversations.enablePinConversation = true // off by default
```

Pinning applies immediately; **unpinning asks for confirmation first**. Hide the action on a single list with [`hidePinConversationOption`](#hidepinconversationoption) while it stays available elsewhere.

### Admin Pins

An app can also pin a conversation **for everyone**. A system pin sorts above every personal pin, and is not the user's to remove — the kit does not offer the unpin affordance on those rows at all.

Check warning on line 422 in ui-kit/ios/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/conversations.mdx#L422

Did you really mean 'affordance'?

To reflect the same distinction in a view of your own, read the two properties the SDK exposes on `Conversation`:

```swift lines
import CometChatSDK

// `pinnedAt` uses a 0 sentinel, so presence — not `> 0` — is the pinned test.
let isPinned = conversation.pinnedAt != 0

// An admin/global pin. A user cannot unpin one, so hide or disable your unpin control.
let isSystemPinned = isPinned && conversation.pinnedBy == "app_system"
```

<Note>
The UI Kit has no public helper for this yet — unlike the React Native kit's `isSystemPinnedConversation()` — so the `"app_system"` sentinel has to be compared directly for now.
</Note>

### Errors

A failed pin surfaces as a toast. `PinConversationErrorCodes` names the codes the backend emits, so you can match them in your own handling:

| Code | Meaning |
|---|---|
| `ERR_PINNED_CONVERSATIONS_LIMIT_EXCEEDED` | The user is at the per-user pinned cap. The real cap rides in `errorParams` — never hard-code it. |
| `ERR_CONVERSATION_NOT_ACCESSIBLE` | No conversation row yet (never messaged), or deleted-for-me. |
| `ERR_PERMISSION_DENIED` | RBAC denial. |
| `ERR_BAD_REQUEST` | Invalid `pinnedBy` filter or malformed body. |

---

## Custom View Slots

| Slot | Signature | Replaces |
|------|-----------|----------|
| `listItemView` | `(Conversation) -> UIView` | Entire conversation row |
| `leadingView` | `(Conversation) -> UIView` | Avatar / left section |

Check warning on line 458 in ui-kit/ios/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/conversations.mdx#L458

Did you really mean 'leadingView'?
| `titleView` | `(Conversation) -> UIView` | Name / title text |

Check warning on line 459 in ui-kit/ios/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/conversations.mdx#L459

Did you really mean 'titleView'?
| `subtitleView` | `(Conversation) -> UIView` | Last message preview |

Check warning on line 460 in ui-kit/ios/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/conversations.mdx#L460

Did you really mean 'subtitleView'?
| `trailView` | `(Conversation) -> UIView` | Right side (time, badge) |

Check warning on line 461 in ui-kit/ios/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/conversations.mdx#L461

Did you really mean 'trailView'?
| `emptyStateView` | `UIView` | Empty state display — assign a view, not a closure |
| `errorStateView` | `UIView` | Error state display — assign a view, not a closure |
| `loadingView` | `UIView` | Loading state display — assign a view, not a closure |
Expand Down Expand Up @@ -740,7 +792,7 @@
| List item look | Style | `listItemBackground` | `UIColor(white: 0.95, alpha: 1.0)` |
| Unread badge | Style | `badgeStyle` | `BadgeStyle()` with custom colors |
| Avatar appearance | Style | `avatarStyle` | `AvatarStyle()` with custom radius |
| Hide search | Property | `hideSearch` | `conversations.hideSearch = true` |

Check warning on line 795 in ui-kit/ios/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/conversations.mdx#L795

Did you really mean 'hideSearch'?
| Hide receipts | Property | `hideReceipts` | `conversations.hideReceipts = true` |
| Custom row | View Slot | `set(listItemView:)` | See Custom View Slots section |

Expand Down Expand Up @@ -938,7 +990,7 @@

#### set(textFormatters:)

Sets custom text formatters for processing and displaying message text in conversation subtitles.

Check warning on line 993 in ui-kit/ios/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/conversations.mdx#L993

Did you really mean 'formatters'?

```swift lines
@discardableResult
Expand All @@ -947,7 +999,7 @@

| Parameter | Type | Description |
|-----------|------|-------------|
| `textFormatters` | `[CometChatTextFormatter]` | Array of text formatters to apply to message text |

Check warning on line 1002 in ui-kit/ios/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/conversations.mdx#L1002

Did you really mean 'textFormatters'?

Check warning on line 1002 in ui-kit/ios/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/conversations.mdx#L1002

Did you really mean 'formatters'?

```swift lines
import CometChatUIKitSwift
Expand All @@ -967,7 +1019,7 @@

All props are optional. Sorted alphabetically.

### avatarStyle

Check warning on line 1022 in ui-kit/ios/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/conversations.mdx#L1022

Did you really mean 'avatarStyle'?

Customizes the appearance of avatars in conversation list items.

Expand All @@ -990,7 +1042,7 @@
conversations.avatarStyle = avatarStyle
```

### badgeStyle

Check warning on line 1045 in ui-kit/ios/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/conversations.mdx#L1045

Did you really mean 'badgeStyle'?

Customizes the appearance of unread message count badges.

Expand Down Expand Up @@ -1022,7 +1074,7 @@
| Type | `ConversationRequest.ConversationRequestBuilder?` |
| Default | `nil` |

### dateStyle

Check warning on line 1077 in ui-kit/ios/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/conversations.mdx#L1077

Did you really mean 'dateStyle'?

Customizes the appearance of date/time labels in conversation list items.

Expand Down Expand Up @@ -1083,7 +1135,7 @@
| Type | `Bool` |
| Default | `false` |

### disableTyping

Check warning on line 1138 in ui-kit/ios/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/conversations.mdx#L1138

Did you really mean 'disableTyping'?

Disables typing indicators in the conversation list.

Expand All @@ -1099,6 +1151,24 @@
conversations.disableTyping = true
```

### enablePinConversation

*Available since v5.1.22*

Adds the **Pin / Unpin** swipe action to each row. Off by default — see [Pinning Conversations](#pinning-conversations) for the feature, including the app setting it also requires.

| | |
|---|---|
| Type | `Bool` |
| Default | `false` |

```swift lines
import CometChatUIKitSwift

let conversations = CometChatConversations()
conversations.enablePinConversation = true
```

### hideBackButton

Hides the back button in the navigation bar.
Expand Down Expand Up @@ -1135,7 +1205,25 @@
| Type | `Bool` |
| Default | `false` |

### hidePinConversationOption

*Available since v5.1.22*

Hides the Pin / Unpin swipe action on one list while the feature stays on elsewhere. ANDed with `enablePinConversation` and the app setting — see [Pinning Conversations](#pinning-conversations).

Check warning on line 1212 in ui-kit/ios/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/conversations.mdx#L1212

Did you really mean 'ANDed'?

| | |
|---|---|
| Type | `Bool` |
| Default | `false` |

```swift lines
import CometChatUIKitSwift

let conversations = CometChatConversations()
conversations.hidePinConversationOption = true
```

### hideReceipts

Check warning on line 1226 in ui-kit/ios/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/conversations.mdx#L1226

Did you really mean 'hideReceipts'?

Hides read/delivered receipt indicators.

Expand Down Expand Up @@ -1214,7 +1302,7 @@
conversations.protectedGroupIcon = UIImage(systemName: "lock.shield.fill")
```

### receiptStyle

Check warning on line 1305 in ui-kit/ios/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/conversations.mdx#L1305

Did you really mean 'receiptStyle'?

Customizes the appearance of message receipt indicators (sent, delivered, read).

Expand Down Expand Up @@ -1269,7 +1357,7 @@

### textFormatters

Array of text formatters for customizing message text display.

Check warning on line 1360 in ui-kit/ios/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/conversations.mdx#L1360

Did you really mean 'formatters'?

| | |
|---|---|
Expand Down Expand Up @@ -1362,7 +1450,7 @@
})
```

### Available Formatters

Check warning on line 1453 in ui-kit/ios/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/ios/conversations.mdx#L1453

Did you really mean 'Formatters'?

| Formatter | Purpose | Default Format |
|-----------|---------|----------------|
Expand Down
Loading
Loading