pushViewController
method instead of presenting the view controller.set(OnItemClick:)
is triggered when you click on a ListItem of the Conversations component. This set(OnItemClick:)
method proves beneficial when a user intends to customize the on-click behavior in CometChatConversations.
set(OnItemLongClick:)
is triggered when you long press on a ListItem of the Conversations component. This set(OnItemLongClick:)
method proves beneficial when a user intends to additional functionality on long press on list item in CometChatConversations.
set(onBack:)
method becomes valuable when a user needs to override the action triggered upon pressing the back button in CometChatConversations.
set(onSelection:)
only gets trigger when selection mode is set to multiple of single. And this gets trigger on every selection, and returns the list of selected conversations.
set(onEmpty:)
method is triggered when the conversations list is empty in CometChatConversations.
ConversationsRequestBuilder
in the Conversations Component to filter the conversation list. You can modify the builder as per your specific requirements with multiple options available to know more refer to ConversationRequestBuilder.
You can set filters using the following parameters.
User
or Groups
Tag
Tag
Tag
pushViewController
method instead of presenting the view controller.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.
Property | Description | Code |
---|---|---|
Background Color | Used to set the background color of the conversation screen. | CometChatConversation.style.backgroundColor = UIColor.white |
Background Drawable | Used to set a background image for the conversation screen. | CometChatConversation.style.backgroundDrawable = UIImage(named: "background") |
Border Width | Used to set the border width of the conversation UI. | CometChatConversation.style.borderWidth = 2.0 |
Border Color | Used to set the border color of the conversation UI. | CometChatConversation.style.borderColor = UIColor.gray |
Corner Radius | Used to set the corner radius of the conversation UI. | CometChatConversation.style.cornerRadius = 10.0 |
Back Icon Tint | Used to set the tint color of the back icon in the conversation UI. | CometChatConversation.style.backIconTint = UIColor.blue |
Back Icon | Used to set a custom back icon for the conversation UI. | CometChatConversation.style.backIcon = UIImage(named: "customBackIcon") |
Separator Color | Used to set the color of separators in the conversation list. | CometChatConversation.style.separatorColor = UIColor.lightGray |
Separator Width | Used to set the width of separators in the conversation list. | CometChatConversation.style.separatorWidth = 1.0 |
Error Text Color | Used to set the color of error messages in the conversation UI. | CometChatConversation.style.errorTextColor = UIColor.red |
Last Message Text Color | Used to set the color of the last message text in the conversation list. | CometChatConversation.style.lastMessageTextColor = UIColor.darkGray |
Typing Indicator Color | Used to set the color of the typing indicator in the conversation UI. | CometChatConversation.style.typingIndicatorColor = UIColor.green |
Title Appearance | Used to customize the appearance of the conversation screen’s title. | CometChatConversation.style.titleAppearance = UIFont.boldSystemFont(ofSize: 18.0) |
Last Message Appearance | Used to customize the appearance of the last message text in the list. | CometChatConversation.style.lastMessageAppearance = UIFont.italicSystemFont(ofSize: 14.0) |
Thread Indicator Appearance | Used to customize the appearance of thread indicators in the list. | CometChatConversation.style.threadIndicatorTextAppearance = UIFont.systemFont(ofSize: 12.0) |
Avatar Style | Used to customize the appearance of avatars in the conversation list. | CometChatConversation.style.avatarStyle = customAvatarStyle |
Status Indicator Style | Used to customize the style of status indicators for online/offline members. | CometChatConversation.style.statusIndicatorStyle = customStatusIndicatorStyle |
Date Style | Used to customize the appearance of date labels in the conversation list. | CometChatConversation.style.dateStyle = customDateStyle |
Badge Style | Used to customize the appearance of badges in the conversation list. | CometChatConversation.style.badgeStyle = customBadgeStyle |
List Item Style | Used to customize the appearance of the list items in the conversation list. | CometChatConversation.style.listItemStyle = customListItemStyle |
Avatar
component in the Conversations
Component, you can use the following code snippet. For more information, visit Avatar Styles.
Global level styling
Conversations
Component, you can use the following code snippet. For more information, visit Indicator Styles.
Global level styling
Badge
component in the Conversations
Component, you can use the following code snippet. For more information, visit Badge Styles
Global level styling
Property | Description | Code |
---|---|---|
hideErrorView | Hides the error state view. | hideErrorView = true |
hideNavigationBar | Hides or shows the navigation bar. | hideNavigationBar = true |
hideSearch | Hides the search bar. | hideSearch = true |
hideBackButton | Hides the back button. | hideBackButton = true |
hideLoadingState | Hides the loading state indicator. | hideLoadingState = true |
hideReceipts | Hides message read/delivery receipts. | hideReceipts = true |
hideDeleteConversationOption | Hides the option to delete a conversation. | hideDeleteConversationOption = true |
hideUserStatus | Hides the online/offline status of users. | hideUserStatus = true |
hideGroupType | Hides the group type (private/public). | hideGroupType = true |
Property | Description | Code |
---|---|---|
time | Called to format a timestamp as a standard time (e.g., “12:30 PM”). | CometChatConversations.dateTimeFormatter.time = { ... } |
today | Called when rendering messages sent today. | CometChatConversations.dateTimeFormatter.today = { ... } |
yesterday | Called for yesterday’s messages. | CometChatConversations.dateTimeFormatter.yesterday = { ... } |
lastweek | Called for messages within the last week. | CometChatConversations.dateTimeFormatter.lastweek = { ... } |
otherDay | Called for dates older than last week. | CometChatConversations.dateTimeFormatter.otherDay = { ... } |
minute | Called when referring to “a minute ago”. | CometChatConversations.dateTimeFormatter.minute = { ... } |
minutes | Called for “x minutes ago”. | CometChatConversations.dateTimeFormatter.minutes = { ... } |
hour | Called for “an hour ago”. | CometChatConversations.dateTimeFormatter.hour = { ... } |
hours | Called for “x hours ago”. | CometChatConversations.dateTimeFormatter.hours = { ... } |
CustomListItemView
as a custom UIView
. Which we will inflate in setListItemView()
CustomLeadingView
as a custom UIView
. Which we will inflate in setLeadingView()
CustomTitleView
as a custom UIView
. Which we will inflate in setTitleView()
CustomTrailView
as a custom UIView
. Which we will inflate in setTrailView()
SubtitleView
a custom UIView
cocoa touch file
and inflate it in the setSubtitleView apply function. Then, you can define individual actions depending on your requirements.
SubtitleView
file should should appear as follows: