Networking Chat Screen
Overview
The LMNetworkingChatViewController displays a list of chatrooms and provides navigation to individual chat screens, search functionality, and a user profile view.
File Location:
LMNetworkingChatViewController.swift
Functionality
Protocols
This screen implements LMHomeFeedListViewDelegate protocol
UI Components
feedListView: An instance ofLMChatHomeFeedListViewthat displays the list of chatrooms.profileIcon: AnLMImageViewshowing the user's profile picture in the navigation bar.newDMFabButton: A floating action button (LMButton) for creating new DMs.
Methods
setupRightItemBars(): Sets up the right navigation bar items (profile and search).setupNewFabButton(): Configures the new DM floating action button.profileItemClicked(): Handles taps on the profile icon.newFabButtonClicked(): Handles taps on the new DM button.searchBarItemClicked(): Handles taps on the search icon.
Customization
To customize the LMNetworkingChatViewController, subclass it and override the necessary methods:
CustomDMFeedViewController
class CustomDMFeedViewController: LMNetworkingChatViewController {
override func newFabButtonClicked() {
super.newFabButtonClicked()
// Add custom handling here
}
}
AppDelegate.swift
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
LMCoreComponents.shared.networkingChatScreen = CustomDMFeedViewController.self
// ...
return true
}