Skip to content

fix(ios): correct v5 UI Kit docs against the shipped 5.1.19 kit - #477

Open
ashfaqcometchat wants to merge 6 commits into
mainfrom
docs/ios-v5-uikit-corrections
Open

fix(ios): correct v5 UI Kit docs against the shipped 5.1.19 kit#477
ashfaqcometchat wants to merge 6 commits into
mainfrom
docs/ios-v5-uikit-corrections

Conversation

@ashfaqcometchat

Copy link
Copy Markdown
Contributor

Why

Building the iOS skills pack (ENG-38208) required an existence oracle for the iOS UI Kit. Cross-checking the docs against that oracle surfaced a class of defect worth fixing at source: pages documenting API that does not exist in the shipped kit, including v4 components left standing on v5 pages.

Everything here is verified against the public .swiftinterface of CometChatUIKitSwift 5.1.19 — the artifact this org's own cometchat-uikit-ios Package.swift pins (sha256 a0f19887…, checked). Nothing is inferred from prose or from another docs page.

The headline defect

components-overview documented — and its Quick Reference actively recommended — four composite components:

CometChatMessages · CometChatUsersWithMessages · CometChatGroupsWithMessages · CometChatConversationsWithMessages

None exist in v5. Verified three ways: 0 occurrences in the public .swiftinterface, no ObjC @interface, and 0 files in the UI Kit source tree declaring them. They are v4 components (11 files under ui-kit/ios/v4/ use them correctly).

This mattered because it was the documented quick-integration path on the canonical component page — code following it does not compile. Replaced throughout with the host-composed pattern the recipe pages (ios-conversation, ios-one-to-one-chat, ios-tab-based-chat) already teach correctly.

Pages in this PR

components-overview.mdx — composites removed; "Configurations" section rewritten (MessageHeaderConfiguration/MessageListConfiguration/MessageComposerConfiguration are also v4-only) to show per-instance configuration; hierarchy diagram re-rooted at the developer's own VC.

conversations.mdx — six style props plus onSearchClick are settable properties, not set(label:) methods; CometChatMentionTextFormatter/CometChatURLTextFormatter replaced with the real CometChatMentionsFormatter (no URL formatter ships); custom empty state corrected to assign a UIView rather than return one from a closure; Quick Reference slot names fixed (tailViewtrailView, loadingStateViewloadingView).

search.mdx — largest divergence. set(onError:)/set(onEmpty:), both request-builder setters, set(initialView:) and the four *ForMessage granular slots do not exist. Replaced with the real surface: set(searchIn:), set(searchFilters:initialFilter:), set(emptyView:)/set(errorView:)/set(loadingView:), set(listItemViewFor*:), and the conversation-level granular properties. SearchScope and SearchFilter cases are now documented. Quick Reference had nine wrong entries — CometChatSearch inherits UIViewController, not CometChatListBase, so it has none of the list-base chrome props.

Verification

Each page passes a mechanical docs-vs-kit API check (extracts Swift fences, resolves receiver types and superclasses, asserts every symbol and set(label:) exists in the shipped interface).

Running total for ui-kit/ios: 19 pages / 76 findings → 17 pages / 55 findings. Remaining pages will be added to this PR as they are fixed.

Note for reviewers

This PR stays open while the rest of ui-kit/ios is corrected — the Mintlify preview it produces is being used as the docs source while the iOS skills are authored, so the skills build against corrected docs rather than the current ones.

…ents-overview, conversations

Every change verified against the public API surface of the CometChatUIKitSwift
5.1.19 xcframework (the artifact github.com/cometchat/cometchat-uikit-ios pins,
sha256 a0f19887…). Nothing here is inferred from prose or from another page.

components-overview.mdx
  - Removes the "Composite Components" section and every reference to
    CometChatMessages / CometChat{Users,Groups,Conversations}WithMessages. These
    are v4 components; 5.1.19 contains none of them (0 occurrences in the public
    .swiftinterface, no ObjC @interface, absent from the source tree). The page
    was actively RECOMMENDING them as the quick-integration path.
  - Replaces them with the host-composed pattern the clean recipe pages already
    teach: a list component + your own chat screen (MessageHeader + MessageList
    + MessageComposer), linking to ios-conversation / ios-one-to-one-chat /
    ios-tab-based-chat rather than duplicating them.
  - Rewrites "Configurations": MessageHeaderConfiguration, MessageListConfiguration
    and MessageComposerConfiguration do not exist in v5 either — that whole section
    described the v4 pass-config-into-a-composite model. Now shows per-instance
    configuration with verified API: set(user:), set(controller:), set(subtitleView:),
    set(emptyView:), set(errorView:), placeholderText, hideBackButton.
  - Re-roots the hierarchy diagram at YourNavigationController / MessagesVC so the
    ownership boundary is explicit.
  - AI Quick Reference: compositeComponents -> a `composition` block that positively
    states no composite ships and names the three parts. An agent reading only that
    block now gets the right answer instead of a phantom.

conversations.mdx
  - Six styles + onSearchClick are public VARS, not set(label:) methods. Converted
    to property assignment: conversations.avatarStyle = …, .badgeStyle, .dateStyle,
    .receiptStyle, .statusIndicatorStyle, .typingIndicatorStyle, .onSearchClick.
  - CometChatMentionTextFormatter and CometChatURLTextFormatter do not exist. The
    kit ships CometChatTextFormatter and CometChatMentionsFormatter (plural) only —
    there is no URL formatter at all, so the example no longer implies one.
  - Custom empty state: the API takes a UIView, not a closure. Now assigns
    emptyStateView (inherited from CometChatListBase) with set(emptyView:) noted as
    the builder equivalent, plus emptyStateTitleText/emptyStateSubTitleText for the
    keep-the-default case.
  - CometChatMessages -> your own MessagesVC, with user/group passed from
    conversation.conversationWith.
  - AI Quick Reference slot names: tailView -> trailView, loadingStateView ->
    loadingView, and emptyStateView/errorStateView retyped as UIView rather than
    () -> UIView.

Both pages now pass the docs-vs-kit API check with zero findings.

Ref: cometchat-skills DOCS-BACKLOG G12 / features.ios-v5.json IOS-DOCS-001.
CometChatSearch's documented API diverged furthest from the shipped component.
Every replacement below is taken from the 5.1.19 public .swiftinterface.

Removed — these do not exist on CometChatSearch:
  set(onError:) / set(onEmpty:)      failures and empty results are VIEWS, not
                                     callbacks: set(errorView:), set(emptyView:),
                                     errorStateTitleText, errorStateSubTitleText
  set(conversationsRequestBuilder:)  no request builder at all; scope with
  set(messagesRequestBuilder:)       set(searchIn:) + set(searchFilters:initialFilter:),
                                     or user/group for a single conversation
  set(initialView:)                  no pre-search view API exists — section removed
                                     rather than left describing something unbuildable
  set(leadingViewForMessage:)        the ForMessage granular slots do not exist. The
  set(titleViewForMessage:)          only message-level slot is set(listItemViewForMessage:)
  set(subtitleViewForMessage:)       (plus the per-media variants). The granular slots
  set(trailingViewForMessage:)       exist for CONVERSATIONS only, as assignable
                                     properties: leading/title/subtitle/tailViewForConversation

Documented correctly for the first time:
  SearchScope  = .conversations | .messages
  SearchFilter = .messages | .conversations | .unread | .groups | .photos | .videos
                 | .links | .documents | .audio

AI Quick Reference (the block agents read first) had nine wrong entries. Fixed:
dropped the two request builders, onBack/onError/onEmpty, and hideNavigationBar/
hideBackButton/hideReceipts — CometChatSearch inherits UIViewController, NOT
CometChatListBase, so it has none of the list-base chrome. Added the five
per-media listItemViewFor* slots that were missing, and marked
onConversationClicked/onMessageClicked as assignable properties.

Also replaced the CometChatMessages composite references (IOS-DOCS-001) with the
host-composed MessagesVC, and repointed an itemView cross-reference from
CometChatMessages to CometChatMessageList.

search.mdx now passes the docs-vs-kit API check with zero findings.
Running total across ui-kit/ios: 19 pages / 76 findings -> 17 pages / 55 findings.
@mintlify

mintlify Bot commented Aug 20, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
cometchat 🟢 Ready View Preview Aug 20, 2026, 8:36 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

…5 page

users.mdx — verified against 5.1.19:
  set(usersRequestBuilder:) -> set(userRequestBuilder:)   (singular "user")
  set(subtitleView:)        -> set(subtitle:)             ((User?) -> UIView)
  set(trailView:)           -> set(trailingView:)         ((User?) -> UIView)
  set(avatarStyle:) / set(statusIndicatorStyle:) -> public vars, assigned
  set(emptyStateView:) closure -> emptyStateView is a UIView you assign
                                  (inherited from CometChatListBase)
  set(onSelection:) left as-is — it IS real on CometChatUsers.

groups.mdx — same subtitle/trailingView/style/emptyStateView corrections, plus:
  set(onSelection:) -> onSelectedItemProceed. CometChatGroups has NO onSelection
  (CometChatUsers does). Groups exposes onDidSelect (per row) and
  onSelectedItemProceed (multi-select confirm).

Note for future edits: these renames are PER TYPE, not global. CometChatGroupMembers
genuinely ships set(subtitleView:) and set(trailView:) — the kit is internally
inconsistent, so a blanket search-and-replace would break the one page that is right.

IOS-DOCS-001 cleanup — CometChatMessages and the *WithMessages composites are now
gone from every v5 page (12 files). Code samples instantiate the developer's own
MessagesVC / ChatListVC with a pointer to the recipe page; prose and AI Quick
Reference component lists name the three real components instead. The v2/v3/v4
trees are untouched, and upgrading-from-v4.mdx keeps its 4 references — a migration
page must name what it migrates away from.

Running total for ui-kit/ios: 19 pages / 76 findings -> 10 pages / 24 findings.
…an against 5.1.19

Wrong CALL FORM (member exists as a settable property, not set(label:)):
  CometChatCallButtons   onVoiceCallClick, onVideoCallClick
  CometChatMessageHeader avatarStyle, statusIndicatorStyle, typingIndicatorStyle,
                         onAiChatHistoryClicked, onAiNewChatClicked
                         (the two AI hooks also take (User) -> Void, not () -> Void)
  CometChatGroupMembers  menus ([UIBarButtonItem]?), onSelectedItemProceed, emptyStateView
  CometChatMessageList   emptyStateView

Renamed:
  set(callSettingBuilder:) -> set(callSettingsBuilder:)   (plural)
  set(onDeclineClick:)     -> set(onCancelClick:)         ((Call?, UIViewController?) -> Void)
  set(sessionID:)          -> set(sessionId:)             (casing — would not compile)
  CometChatDateStyle       -> DateStyle                   (this one is un-prefixed)

Absent, replaced with what actually ships:
  CometChatMessageList/Composer set(parentMessage:) -> set(parentMessageId: Int).
    Note CometChatThreadedMessageHeader DOES take set(parentMessage: BaseMessage) —
    left untouched. Three components, two different parent APIs.
  CometChatGroupMembers set(onSelection:) -> onSelectedItemProceed (no onSelection here)
  CometChatMessageHeaderOption -> CometChatPopupMenu.MenuItem(title:icon:action:);
    set(options:) takes [CometChatPopupMenu.MenuItem]?, not a closure returning options
  CometChatAddMembers -> no such component. Sample now builds its own picker and points
    at CometChat.addMembersToGroup(guid:groupMembers:bannedUIDs:onSuccess:onError:)
    (/sdk/ios/group-add-members) — UI Kit first, SDK where the kit has nothing.
  CometChatAvatar set(user:) -> setAvatar(avatarUrl:with:) (its only other API is set(image:))

ui-kit/ios: 51 pages scanned, 0 findings. Started at 19 pages / 76 findings.
…e table row

guide-ai-agent.mdx declares its components as `private var messageList:
CometChatMessageList!` and assigns them later. The checker only resolved
let/var-with-initialiser and lazy-var forms, so every call on those receivers was
silently skipped — hiding messageList/messageComposer set(parentMessage:) (they
take set(parentMessageId: Int); only CometChatThreadedMessageHeader takes a
BaseMessage) and messageList.set(emptyStateView:) (an assignable UIView).

Fixed the receiver resolution in test-suite/scripts/verify-swift-docs-api.mjs
rather than hand-patching the page, so the whole class is caught from now on.

groups.mdx also had a prose table row still naming `set(onSelection:)`, which
CometChatGroups does not have. The checker scans code fences only, so prose and
tables need a separate sweep — noted for the remaining docs work.

ui-kit/ios: 51 pages, 0 findings.
…re is no .both

conversations.mdx taught `.set(conversationType: .both)`. Two errors, both verified
against CometChatSDK 4.1.7 as shipped inside the 5.1.19 kit:

  method  ConversationRequestBuilder ships setConversationType(conversationType:),
          NOT set(conversationType:). Zero matches for the documented form.
  case    CometChat.ConversationType has .user / .group / .none. There is no .both.
          To get both 1:1s and groups you omit the call — that is the default.

Fixed the Filtering example, both Filter Recipes rows, the two later usages, and the
ConversationType block in the AI Quick Reference.

Found by reviewing the iOS core skill against the kit rather than by the checker: the
checker only indexed top-level declarations, so a NESTED type
(ConversationRequest.ConversationRequestBuilder) was never indexed and every call on
it was silently skipped. Checker fixed alongside.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant