Skip to main content

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.

LMFeedCreatePollMetaView

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 config
  • onValueChanged(for id: Int) Called when user changes meta configuration of poll

UI Elements

  • containerView: A container view that holds all other subviews
  • metaOptionStackView: A vertical stack view that contains metadata option widgets
  • optionContainerView: A view that holds the user option controls
  • titleLabel: A label indicating the section for user voting options
  • optionTypeButton: A button to display and select the type of user option
  • maxOptionButton: A button to display and select the maximum number of options a user can vote for
  • equalSymbol: An image view showing an equal sign icon

Data Variables

  • delegate: A delegate conforming to the LMFeedCreatePollMetaViewProtocol
  • userOptions: 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
}