Reaction Sheet
Overview
The LMChatReactionViewController is a customizable view controller responsible for displaying and managing a bottom sheet of reaction options for chat messages. It provides a user interface for viewing and interacting with message reactions within a chat application.
File Location:
LMChatReactionViewController.swift
Functionality
Protocols
LMReactionViewControllerDelegate
reactionDeleted(chatroomId:conversationId:): Called when a reaction is deleted.
UI Components
containerView: ALMViewthat serves as the main container for the bottom sheet.dimmedView: ALMViewthat provides a dimmed background when the bottom sheet is presented.tableView: ALMTableViewthat displays the reaction emojis and their counts.collectionView: ALMCollectionViewthat shows reaction categories or filters.titleLabel: ALMLabeldisplaying the title "Reactions".bottomLine: ALMViewthat serves as a separator between the collection view and table view.
Properties
delegate: A weak reference to an object conforming toLMReactionViewControllerDelegate.titleData: An array ofLMChatReactionTitleCell.ContentModelfor the collection view.emojiData: An array ofLMChatReactionViewCell.ContentModelfor the table view.
Methods
animatePresentContainer(): Animates the presentation of the container view.animateShowDimmedView(): Animates the appearance of the dimmed background.didTapDimmedView(): Dismisses the view controller when the dimmed area is tapped.
Customization
class CustomReactionViewController: LMChatReactionViewController {
override func setupViews() {
super.setupViews()
containerView.backgroundColor = .systemBackground
}
}
AppDelegate.swift
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
LMUIComponents.shared.reactionListScreen = CustomReactionViewController.self
// ...
return true
}