Architecture Layers
The store lives in
CometChatCore and is shared by both toolkits, so the SwiftUI and UIKit
screens can never disagree about what to show. An app links one toolkit.
Providing the Store
Every list component accepts a store you create. Use it to configure fetching before the screen appears, to call the store’s methods, or to inject a seeded store for previews and tests.- SwiftUI
- UIKit
@Observable, so SwiftUI views and UIKit observation both follow their state. See
Stores & Data.
Policies instead of overrides
Behaviour hooks live on a policy — a value of closures the store consults — so you change one rule without subclassing:- SwiftUI
- UIKit
Subclassing (UIKit)
The UIKit toolkit keepsopen classes and override points — defaultSetup(),
setupStyle(), reloadData(), the cell’s configure(…). The
SwiftUI toolkit has no subclassing: views are values, and behaviour comes from arguments,
modifiers and policies.
- SwiftUI
- UIKit
Wrap the component in your own view and pass it arguments:
SDK Listeners vs UI Kit Events
Stores use two event systems:
Both are needed: the SDK does not echo this user’s own actions back. See
Events & Callbacks.
Customization Categories
View Slots
Replace one region of a row — leading, title, subtitle, trailing — or the whole row.
Styles
SwiftUI style values and UIKit style objects, and how they resolve.
Stores & Data
Request builders, store state, store methods and seeded stores.
Events & Callbacks
Taps, selection, and the Kit’s event bus.
State Views
Replace or hide the loading, empty and error views.
Text Formatters
Process message text — hashtags, mentions, any pattern.
Menu & Options
Add or replace context-menu actions and composer attachment options.