Component-Level Callbacks
Click Callbacks
- SwiftUI
- UIKit
CometChatSDK.Conversation.Selection Mode
- SwiftUI
- UIKit
selection is a Binding, so your view owns it. onSelection fires once, when the
user submits from the selection toolbar:onItemClick and onItemLongClick do not
fire.
Global Events
The SDK tells you what other people did. It does not echo this user’s own actions back, so the Kit has an event bus: the component that performs an action announces it — a message sent, a user blocked, a member kicked — and every other component showing the same data updates.Subscribing to Events
- SwiftUI
- UIKit
Every event has a view modifier that listens while the view is on screen:Or one modifier per family:Outside a view, iterate the family’s stream:
Emitting Events
Emit when a screen you built does something the Kit cannot see — blocking from your own profile screen, creating a group from your own form — or the Kit’s lists go stale.- SwiftUI
- UIKit
CometChatSession.sendTextMessage(_:) in SwiftUI,
CometChatUIKit.sendTextMessage(message:) in UIKit — and the Kit announces them for you.
Key Event Types
Message events
Call events
Conversation events
The SwiftUI name is the case of the family’s event enum (
CometChatMessageEvent …); the UIKit name is the listener method
and the static emitter.
Component vs Global Events
Related
- Events — every event, in both toolkits.
- Customization Overview — SDK listeners and Kit events.