CometChatMentionsFormatter
class is a part of the CometChat UI Kit, a ready-to-use chat UI component library for integrating CometChat into your iOS applications. This class provides functionality to format mentions within text messages displayed in the chat interface. Mentions allow users to reference other users within a conversation, providing a convenient way to direct messages or involve specific participants.
CometChatMentionsFormatter
class into your application:
CometChatMentionsFormatter
class and configure it with desired settings, such as mention text styles and limit settings.
.setonMentionCLicked
).
.set(leftBubbleTextStyle)
, .set(rightBubbleTextStyle)
, .set(composerTextStyle)
, and .set(conversationListTextStyle)
methods to format text messages with mentions appropriately for display in the chat interface.
CometChatMentionsFormatter
can directly be initialised, tweak using its properties and passed into different configurations.
Below is an example demonstrating how to use the CometChatMentionsFormatter
class in components such as CometChatConversations, CometChatMessageList, CometChatMessageComposer.
showToastMessage
.
Methods | Description | Code |
---|---|---|
Set Conversation List TextStyle | Use to set stying for conversation list’s formatted text. | MentionTextStyle |
Set GroupMembersRequestBuilder | Sets the builder for fetching group members. | GroupMembersRequest.GroupMembersRequestBuilder? |
Set UsersRequestBuilder | Sets the builder for fetching users. | UsersRequest.UsersRequestBuilder? |
Set OnMentionCLick | Sets a listener for mention click in Message Bubbles events. | ((_ baseMessage: BaseMessage, _ tappedText: String, _ controller: UIViewController?)->()) |
Set composerTextStyle | Use to set stying for composer’s formatted text. | MentionTextStyle |