Explore Chatroom List View
Overview
The LMExploreChatroomListView displays explorable chatrooms. It shows a list of chatrooms, allows for filtering, and provides navigation to individual chat screens.
File Location:
LMExploreChatroomListView.swift
Functionality
Protocols
LMChatExploreChatroomFilterProtocol
applyFilter(with:): Applies a filter to the chatroom list.applyPinnedStatus(): Applies a filter for pinned chatrooms.
Protocols Implemented
- LMChatExploreChatroomProtocol
- LMChatExploreChatroomFilterProtocol
UI Components
containerView: An LMView that serves as the main container for the screen.loadingView: An instance ofLMChatHomeFeedShimmerViewused for loading animations.tableView: An LMTableView that displays the list of chatrooms.
Properties
data: An array ofLMChatHomeFeedChatroomCell.ContentModelobjects.chatroomData: An array ofLMChatExploreChatroomView.ContentModelobjects representing the chatrooms.
Methods
updateChatroomsData(chatroomData:): Updates the chatroom data and refreshes the table view.
Customization
CustomExploreChatroomListView.swift
class CustomExploreChatroomListView: LMExploreChatroomListView {
override func setupAppearance() {
super.setupAppearance()
// Add custom appearance setup here
}
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
super.tableView(tableView, didSelectRowAt: indexPath)
// Add custom selection handling here
}
}
AppDelegate.swift
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
LMUIComponents.shared.exploreChatroomListScreen = CustomExploreChatroomListView.self
// ...
return true
}