Skip to main content

Create Poll Display

Overview

LMFeedCreateDisplayPollView is used for displaying poll preview during Post Creation or Edit Screen

LMFeedCreatePollDateView

Protocol

LMFeedCreatePollViewProtocol

A protocol defining the interactions for a poll creation view.

  • onTapCrossButton(): Called when the cross button is tapped.
  • onTapEditButton(): Called when the edit button is tapped.

UI Elements

  • questionStackView: A horizontal stack view containing the question and action buttons
  • crossButton: A button for removing the poll
  • editButton: A button for editing the poll

Data Variables

  • delegate: Instance of LMFeedCreatePollViewProtocol for handling button actions

Actions

  • onTapCrossButton(): Calls the delegate method onTapCrossButton() when the cross button is tapped.

  • onTapEditButton(): Calls the delegate method onTapEditButton when the edit button is tapped.

Methods

  • configure(with data: ContentModel, delegate: LMFeedCreatePollViewProtocol?): Configures the view with the given data model and sets the delegate.

Customisation

CustomCreateDisplayPollView.swift
class CustomCreateDisplayPollView: LMFeedCreateDisplayPollView {
override func setupAppearance() {
super.setupAppearance()

containerView.backgroundColor = .green
}
}
AppDelegate.swift
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
LMUIComponents.shared.createPollDisplayView = CustomCreateDisplayPollView.self
// ...
return true
}