Skip to main content

Document Cell

Overview

The LMChatDocumentViewCell is a subclass of LMChatMessageCell designed to display document messages in a chat. It encapsulates an LMChatDocumentContentView to handle the presentation of document attachments within the cell.

UI Components

  • documentMessageView: An instance of LMChatDocumentContentView that manages the display and interaction of document content within the cell.

Methods

  • setData(with:index:): Populates the cell with data from a ContentModel and configures the "Show More" callback.

Customization

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

override func setData(with data: ContentModel, index: IndexPath) {
super.setData(with: data, index: index)
// Customize data population or add additional configuration
}
}
AppDelegate.swift
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
LMUIComponents.shared.chatMessageDocumentCell = CustomDocumentViewCell.self
// ...
return true
}