Skip to main content

Reply View

Overview

LMFeedReplyView is crafted to showcase individual reply within the context of a feed post comment, providing a structured and interactive representation of user comments' reply.

LMFeedPostDetailCommentCell

UI Components

  • containerView: An instance of LMView serving as the main container for all other subviews.
  • authorNameLabel: An instance of LMLabel used to display the name of the comment's author.
  • commentStack: An instance of LMStackView that vertically aligns the comment and the see-more text button.
  • commentContainerStack: An instance of LMStackView that horizontally aligns the comment stack and the menu button.
  • commentLabel: An instance of LMTextView used to display the text of the comment.
  • menuButton: An instance of LMButton used to present additional options related to the comment.
  • actionStack: An instance of LMStackView that horizontally aligns action buttons like like, reply, and the separator view.
  • likeButton: An instance of LMButton that lets users like the comment.
  • likeTextButton: An instance of LMButton used to display the number of likes a comment has received.
  • sepratorView: An instance of LMView used as a visual separator in the action stack.
  • replyButton: An instance of LMButton that allows users to reply to the comment.
  • replyCountButton: An instance of LMButton used to display the number of replies a comment has received.
  • commentTimeLabel: An instance of LMLabel that shows when the comment was made.

Data Variables

  • viewModel: An instance of LMFeedPostDetailCommentCellViewModel used for configuring the cell with specific comment data, including content, commenter information, and interaction counts.
  • delegate: A weak reference to an object conforming to LMFeedPostCommentProtocol, which is notified about interaction events within the cell.

Methods

  • configure(): Configures the view, setting up its content and appearance based on the model's data.

Action Handlers

  • didTapProfileImage(): Invoked when the commenter's profile image is tapped. This action informs the delegate to potentially navigate to the commenter's profile.

  • didTapLikeButton(): Toggles the like state for the comment, updates the UI to reflect this change, and informs the delegate about the like interaction.

  • didTapReplyButton(): Signals the delegate when the reply button is tapped, indicating that the user wishes to reply to the comment.

Customisation

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