Skip to main content

Participant List View

Overview

The LMChatParticipantListView is a view that displays a list of chat participants. It provides a table view to show participant information and supports delegate methods for handling user interactions and pagination.

File Location:
LMChatParticipantListView.swift

Functionality

Protocols

LMParticipantListViewDelegate

Defines methods that are triggered from tableview and are implemented by the viewcontroller using it

  • didTapOnCell(indexPath: IndexPath): Called when a participant cell is tapped.
  • loadMoreData(): Called when the table view needs to load more participants.

UI Components

  • containerView: A LMView that serves as the main container for the participant list.
  • loadingView: An instance of LMChatHomeFeedShimmerView used as a loading indicator.
  • tableView: A LMTableView that displays the list of participants.

Data Variables

  • cellHeight: A constant CGFloat value representing the height of each cell in the table view.
  • data: An array of LMChatParticipantCell.ContentModel objects containing participant information.
  • delegate: A weak reference to an object conforming to LMParticipantListViewDelegate.

Methods

  • reloadList(): Refreshes the table view and updates the background view based on data availability.

Customization

CustomParticipantListView.swift
class CustomParticipantListView: LMChatParticipantListView {
override func setupAppearance() {
super.setupAppearance()

tableView.backgroundColor = .lightGray
}
}
AppDelegate.swift
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
LMUIComponents.shared.participantListView = CustomParticipantListView.self
// ...
return true
}