Topic Cell
Overview
LMFeedPostTopicCell
is a subclass of LMPostWidgetTableViewCell used for displaying topics in the LikeMinds Feed module. It showcases the topics associated with a post, allowing users to see and interact with them. The layout is managed using Auto Layout to ensure proper arrangement and sizing of the topic view.
File Location:
LMFeedPostTopicCell.swift
Functionality
Protocols
LMFeedPostTopicCellProtocol
Conforms to LMPostWidgetTableViewCellProtocol
. It includes functions for handling interactions within the topic cell:
- No specific protocol methods are defined for
LMFeedPostTopicCell
in the base implementation.
UI Components
topicFeed
: An LMFeedTopicView used to display the topics associated with a post.
Data Variables
configure(data:)
: Configures the cell with the givenLMFeedPostContentModel
data, setting up the topics view and hiding it if there are no topics.
Methods
configure(data:)
: Configures the cell with the provided data, setting up the topic view and determining its visibility based on the content model.
Action Handlers
- No specific action handlers are defined for
LMFeedPostTopicCell
in the base implementation.
Customisation
CustomTopicCell.swift
class CustomTopicCell: LMFeedPostTopicCell {
override func setupAppearance() {
super.setupAppearance()
containerView.backgroundColor = .blue
}
}
AppDelegate.swift
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
LMUIComponents.shared.topicCell = CustomTopicCell.self
// ...
return true
}