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.
Functionality
Protocols
LMReactionViewControllerDelegate
reactionDeleted(chatroomId:conversationId:)
: Called when a reaction is deleted.
UI Components
containerView
: ALMView
that serves as the main container for the bottom sheet.dimmedView
: ALMView
that provides a dimmed background when the bottom sheet is presented.tableView
: ALMTableView
that displays the reaction emojis and their counts.collectionView
: ALMCollectionView
that shows reaction categories or filters.titleLabel
: ALMLabel
displaying the title "Reactions".bottomLine
: ALMView
that 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.ContentModel
for the collection view.emojiData
: An array ofLMChatReactionViewCell.ContentModel
for 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
}