Report Item
Overview
LMFeedReportItem
is designed to display a selectable tag. This cell is typically used in a reporting context, where users can select or deselect tags based on their preferences.
UI Components
textLabel
: AnLMLabel
that displays the tag or label text.
Data Variables
onTapCallback
: A closure that is executed when the cell is tapped.isCellSelected
: A Boolean value that indicates whether the cell is currently selected or not.
Methods
configure()
: Configures the cell with the given tag text, selection state, and tap callback closure.
Action Handlers
didTapView()
: The selector method for the tap gesture recognizer on the cell's container view. It executes theonTapCallback
closure if it is not nil.
Customization
CustomReportViewCell.swift
class CustomReportViewCell: LMFeedReportItem {
override func setupAppearance() {
super.setupAppearance()
containerView.backgroundColor = .green
textLabel.textColor = .white
}
}
AppDelegate.swift
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
LMUIComponents.shared.reportItem = CustomReportViewCell.self
// ...
return true
}