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.
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
: AnLMView
that serves as the main container for the screen.loadingView
: An instance ofLMChatHomeFeedShimmerView
used for loading animations.tableView
: AnLMTableView
that displays the list of chatrooms.
Properties
data
: An array ofLMChatHomeFeedChatroomCell.ContentModel
objects.chatroomData
: An array ofLMChatExploreChatroomView.ContentModel
objects 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
}