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.
UI Components
containerView
: An instance ofLMView
serving as the main container for all other subviews.authorNameLabel
: An instance ofLMLabel
used to display the name of the comment's author.commentStack
: An instance ofLMStackView
that vertically aligns the comment and the see-more text button.commentContainerStack
: An instance ofLMStackView
that horizontally aligns the comment stack and the menu button.commentLabel
: An instance ofLMTextView
used to display the text of the comment.menuButton
: An instance ofLMButton
used to present additional options related to the comment.actionStack
: An instance ofLMStackView
that horizontally aligns action buttons like like, reply, and the separator view.likeButton
: An instance ofLMButton
that lets users like the comment.likeTextButton
: An instance ofLMButton
used to display the number of likes a comment has received.sepratorView
: An instance ofLMView
used as a visual separator in the action stack.replyButton
: An instance ofLMButton
that allows users to reply to the comment.replyCountButton
: An instance ofLMButton
used to display the number of replies a comment has received.commentTimeLabel
: An instance ofLMLabel
that shows when the comment was made.
Data Variables
viewModel
: An instance ofLMFeedPostDetailCommentCellViewModel
used for configuring the cell with specific comment data, including content, commenter information, and interaction counts.delegate
: A weak reference to an object conforming toLMFeedPostCommentProtocol
, 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
}