CometChatReactionsList
component is designed to manage and display reactions associated with messages. It offers a user-friendly interface for users to express their reactions to messages and provides options to remove reactions when necessary. The component intelligently organizes reactions by emoji, giving a clear overview of the variety of reactions for a message along with details of who reacted with each emoji.
The component consists of two distinct lists: one at the top with horizontal scrolling to display unique reactions and their counts, allowing users to select reactions for further details. The middle list shows selected reactions and the users who reacted to them.
Additionally, the interface seamlessly integrates functionality to remove reactions added by the logged-in user.
CometChatReactionList
is a UIViewController that contains a list of reactions. It is commonly used within the CometChatMessageList, but it can be integrated into any UIViewController. The component requires a list of reactions (provided via the baseMessage) to function properly.
navigation controller
, you can use the pushViewController
function instead of presenting the view controller.onClick
event is triggered when a user interacts with a reaction by pressing it, typically to indicate a response or provide feedback.
onTappedToRemoveClicked
callback is triggered when a list item is tapped to remove.
component
’s list by applying specific criteria. Using the ReactionsRequestBuilder
in the Reaction List Component, you can customize your reaction list based on various options to suit your requirements. For more information about ReactionsRequestBuilder, refer to the documentation on ReactionsRequestBuilder.
In the example below, we illustrate how to apply a filter to the reactions list, allowing you to specify a limit on the number of users who have reacted to a particular message.
CometChatConversationsWithMessages
. If a navigation controller is already in use, utilize the pushViewController function instead of directly presenting the view controller.Reactions List
component does not provide any available events.
CometChatReactionsList
component’s visual appearance.
ReactionsListStyle
to customize the appearance using setStyle
method.
Property | Description | Code |
---|---|---|
Background Color | Sets the background color | .set(background: UIColor) |
Corner Radius | Sets the corner radius | .set(cornerRadius: CometChatCornerStyle) |
Border Width | Sets the width of the border | .set(borderWidth: CGFloat) |
Border Color | Sets the color of the border | .set(borderColor: UIColor) |
Subtitle Color | Sets the subtitle color that has “Tap to remove” text | .set(subtitleColor: UIColor) |
Subtitle Font | Sets the font for subtitle that has “Tap to remove” text | .set(subtitleFont: UIFont) |
TailView Font | Sets the font for tailView that has reaction | .set(tailViewFont: UIFont) |
Active Emoji Background Color | Sets the background color for selected emoji in the top slider | .set(activeEmojiBackgroundColor: UIColor) |
Slider Emoji Count Color | Sets the UIColor for emojies count text in the top slidersl | .set(sliderEmojiCountColor: UIColor) |
Error Text Color | Sets the color for error text | .set(errorTextColor: UIColor) |
Error TextFont | Sets the error font | .set(errorTextFont: UIFont) |
Loading Tint | Sets the loading tint color for loading spinner | .set(loadingTint: UIColor) |
Active Emoji Corner Radius | Sets the corner radius for selected emoji in the top slider | .set(activeEmojiCornerRadius: CometChatCornerStyle) |
Avatar
component within the Reaction List
Component, you can use the following code snippet. For more information you can refer Avatar Styles.
ListItemStyle
component within the Reaction List
Component, you can use the following code snippet. For more information, you can refer ListItem Styles.
Reactions List
component does not offer any additional functionality.
.setLoadingStateView()
method. This method allows you to set a custom loading view that will be displayed while the reaction list is loading. It’s important to note that using this method will override the default loading state functionality of the component.
custom_loading_View
.
custom_loading_View
to ReactionListConfiguration
.
CometChatConversationsWithMessages
. If a navigation controller is already in use, utilize the pushViewController function instead of directly presenting the view controller..setErrorStateView()
method. This method allows you to set a custom error view that will be displayed when there’s an error in loading the reaction list. It’s important to note that using this method will override the default error state functionality of the component.
Custom_Error_View
.
Custom_Error_View
to ReactionListConfiguration
.
CometChatConversationsWithMessages
. If a navigation controller is already in use, utilize the pushViewController function instead of directly presenting the view controller.