Skip to main content

Topic Edit View

Overview

LMFeedTopicEditViewCell provides a cell for editing topics within a feed.

LMFeedSelectTopicViewCell

UI Components

  • textLabel: An instance of LMLabel used to display the topic title. It's styled with specific font and text color derived from Appearance.shared.
  • crossButton: An instance of LMButton displaying a cross icon for removing the topic. It's styled with a specific tint color derived from Appearance.shared.

Data Variables

  • topicID: A string representing the ID of the topic.
  • delegate: A weak reference to an object conforming to LMFeedTopicViewCellProtocol, which handles interaction events within the cell.

Methods

  • didTapCrossButton(): Invoked when the user taps the crossButton. Calls the delegate's didTapCrossButton() method to handle the removal of the topic.

  • configure(): Configures the cell with specific data and delegate. Sets the textLabel to display the topic title and assigns the delegate for handling interaction events.

Customisation

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