Skip to main content

Chatroom Cell

Overview

The LMChatHomeFeedChatroomCell is designed to display chatroom information in a home feed or list context. It encapsulates an LMChatHomeFeedChatroomView to present detailed information about a chatroom, including its name, last message, timestamp, and various status indicators.

UI Components

  • chatroomView: An instance of LMChatHomeFeedChatroomView that displays the chatroom information.
  • sepratorView: A view that acts as a separator between cells.

Key Methods

  • configure(with:): Configures the cell with chatroom data.

Customization

CustomHomeFeedChatroomCell.swift
class CustomHomeFeedChatroomCell: LMChatHomeFeedChatroomCell {
override func setupViews() {
super.setupViews()
// Add custom views or modify existing ones
}

override func setupAppearance() {
super.setupAppearance()
// Customize the cell's appearance
sepratorView.backgroundColor = .lightGray
}

override func configure(with data: ContentModel) {
super.configure(with: data)
// Add custom configuration logic
}
}
AppDelegate.swift
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
LMUIComponents.shared.homeFeedChatroomCell = CustomHomeFeedChatroomCell.self
// ...
return true
}