ConversationsWithMessages
is a Composite Component encompassing components such as Conversations, Messages, and Contacts . Each of these component contributes to the functionality and structure of the overall ConversationsWithMessages component.
Components | Description |
---|---|
Conversations | The Conversations component is designed to display a list of either User or Group . This essentially represents your recent conversation history. |
Messages | The Messages component is designed to manage the messaging interaction for either individual User or Group conversations. |
Contacts | The CometChatContacts component is specifically designed to facilitate the display and management of both User and Groups . |
CometChatConversationsWithMessages
is a view controller, it can be launched either by a button click or through any event’s trigger. It inherits all the customizable properties and methods of CometChatConversations.
View Controller: To use ConversationsWithMessages in your view controller
, use the following code snippet.
Navigation controller,
use the following code snippet in your willConnectTo
method in SceneDelegate.
ConversationsConfiguration
object to the CometChatConversations component.
setOnItemClick
method proves beneficial when a user intends to customize the on-click behavior in CometChatConversations.User
import CometChatSDK
Component
. By using event you can extend existing functionality. Being global events, they can be applied in Multiple Locations and are capable of being Added or Removed.
The ConversationsWithMessages does not generate its events but its component does. For a full list of these events, you can refer to Conversations events and Messages events.
In the following example, we’re incorporating observers for the ConversationDeleted
event of Conversations
component.
set(user: User?)
function with a User object as input to ConversationsWithMessages. This will automatically guide you to the Messages component for the designated User
.
set(group: Group?)
function with a Group object as input to ConversationsWithMessages. This will automatically guide you to the Messages component for the designated Group
.
ConversationsConfiguration
object to the CometChatConversations component.
Conversations
subcomponent to navigate the user from Conversations to ContactsMessages
subcomponent to navigate the user from Messages to Details..setMenu()
, the default behavior of ConversationsWithMessages will also be overridden.Conversations
, Messages
, and Contacts
component. Hence, each of these components will have its individual `Configuration“.
Configurations
expose properties that are available in its individual components..setConversationsConfiguration()
method as demonstrated below:
ConversationsConfiguration
object to the CometChatConversations component.
ConversationsConfiguration
can be found under Conversations. Properties marked with the symbol are not accessible within the Configuration Object.
Example
Let’s say you want to change the style of the Conversations subcomponent and, in addition, you only want to display users in the conversation list.
You can modify the style using the ListItemStyle
method and filter the list with the . ConversationsRequestBuilder()
method.
import CometChatSDK