StoryPollComponent

@objc
public final class StoryPollComponent : StoryComponent

This class represents the Poll component.

  • Type of the component

    Declaration

    Swift

    @objc
    public override var type: StoryComponentType { get }
  • Title of the poll if exists

    Declaration

    Swift

    @objc
    public let title: String
  • List of options in the poll

    Declaration

    Swift

    @objc
    public let options: [String]
  • Option index that the user selected

    Declaration

    Swift

    @objc
    public let selectedOptionIndex: Int
  • Custom payload for this poll if exists

    Declaration

    Swift

    @objc
    public let customPayload: String?
  • StoryPollComponent initialization

    Declaration

    Swift

    @objc
    public init(title: String,
                options: [String],
                selectedOptionIndex: Int,
                customPayload: String?)

    Parameters

    title

    Title of the poll if exists

    options

    List of options in the poll

    selectedOptionIndex

    Option index that the user selected

    customPayload

    Custom payload for this poll if exists