Poll Meta Options
Overview
LMFeedCreatePollMetaView
is a customizable view designed to manage and display metadata options for a poll. It includes options for the poll metadata settings.
Protocol
LMFeedCreatePollMetaViewProtocol
A protocol that defines the delegate methods for handling user interactions with metadata options.
onTapUserMetaOptions()
- Called when user taps to change the option selection configonValueChanged(for id: Int)
Called when user changes meta configuration of poll
UI Elements
containerView
: A container view that holds all other subviewsmetaOptionStackView
: A vertical stack view that contains metadata option widgetsoptionContainerView
: A view that holds the user option controlstitleLabel
: A label indicating the section for user voting optionsoptionTypeButton
: A button to display and select the type of user optionmaxOptionButton
: A button to display and select the maximum number of options a user can vote forequalSymbol
: An image view showing an equal sign icon
Data Variables
delegate
: A delegate conforming to the LMFeedCreatePollMetaViewProtocoluserOptions
: An array to hold user options
Methods
configure(with data: ContentModel, delegate: LMFeedCreatePollMetaViewProtocol?)
: Configures the view with the provided content model and delegate
Customisation
CustomCreatePollMetaView.swift
class CustomCreatePollMetaView: LMFeedCreatePollMetaView {
override func setupAppearance() {
super.setupAppearance()
containerView.backgroundColor = .green
}
}
AppDelegate.swift
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
LMUIComponents.shared.createPollMetaView = CustomCreatePollMetaView.self
// ...
return true
}