Topic Edit Icon
Overview
LMFeedTopicEditIcon
is a subclass of LMCollectionViewCell
designed to display an edit icon within a collection view. This cell is typically used in a feed or post creation/edit flow to allow users to edit or modify the selected topics or categories for their posts.
UI Components
editIcon
: AnLMButton
that displays a pencil icon. This button is used to initiate the topic editing process.
Data Variables
editCallback
: A closure that will be executed when the user taps on the edit icon.
Methods
configure()
: Configures the cell with a closure that will be executed when the edit icon is tapped.
Action Handlers
didTapEditIcon()
: The selector method called when the user taps on the edit icon. It executes theeditCallback
closure, if set.
Customisation
CustomTopicEditIcon.swift
class CustomTopicEditIcon: LMFeedTopicEditIcon {
override func setupAppearance() {
super.setupAppearance()
backgroundColor = .green
}
}
AppDelegate.swift
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
LMUIComponents.shared.topicFeedEditIconView = CustomTopicEditIcon.self
// ...
return true
}