Skip to main content

More Replies View

Overview

LMFeedPostMoreRepliesCell is a subclass of LMTableViewHeaderFooterView designed to display a "View more replies" section in a table view. This cell is typically used in a feed or comment thread to allow users to load additional replies or comments.

LMFeedMoreRepliesView

UI Components

  • containerView: The main container view that holds all the subviews.
  • staticLabel: A label displaying the static text "View more replies".
  • countLabel: A label showing the number of visible and total comments or replies.
  • separatorView: A view that acts as a separator or divider at the bottom of the cell.

Data Variables

  • onClick: A closure that will be executed when the user taps on the cell.

Methods

  • configure(): Configures the cell with the total number of comments, the number of currently visible comments, and an optional closure to be executed when the cell is tapped.

Action Handlers

  • didTapView(): The selector method called when the user taps on the cell's container view. It executes the onClick closure, if set.

Customisation

CustomMoreRepliesView.swift

class CustomMoreRepliesView: LMFeedMoreRepliesView {
override func setupAppearance() {
super.setupAppearance()
backgroundColor = .green
}
}
AppDelegate.swift
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
LMUIComponents.shared.loadMoreReplies = CustomMoreRepliesView.self
// ...
return true
}