Skip to main content

Direct Messages Chatrooms Feed

Overview

The LMChatDMFeedViewController displays a list of chatrooms and provides navigation to individual chat screens, search functionality, and a user profile view.

Functionality

Protocols

This screen implements LMHomeFeedListViewDelegate protocol

UI Components

  • feedListView: An instance of LMChatHomeFeedListView that displays the list of chatrooms.
  • profileIcon: An LMImageView showing 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 LMChatDMFeedViewController, subclass it and override the necessary methods:

CustomDMFeedViewController
class CustomDMFeedViewController: LMChatDMFeedViewController {
override func newFabButtonClicked() {
super.newFabButtonClicked()
// Add custom handling here
}
}
AppDelegate.swift
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
LMUIComponents.shared.dmChatFeedScreen = CustomMemberListViewController.self
// ...
return true
}