Topic Edit View
Overview
LMFeedTopicEditViewCell provides a cell for editing topics within a feed.
File Location:
LMFeedTopicEditViewCell.swift
UI Components
textLabel: An instance of LMFeedLabel used to display the topic title. It's styled with specific font and text color derived fromAppearance.shared.crossButton: An instance of LMFeedButton displaying a cross icon for removing the topic. It's styled with a specific tint color derived fromAppearance.shared.
Data Variables
topicID: A string representing the ID of the topic.delegate: A weak reference to an object conforming toLMFeedTopicViewCellProtocol, which handles interaction events within the cell.
Methods
didTapCrossButton(): Invoked when the user taps thecrossButton. Calls the delegate'sdidTapCrossButton()method to handle the removal of the topic.configure(): Configures the cell with specific data and delegate. Sets thetextLabelto 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
}