StoryQuizComponent

@objc
public final class StoryQuizComponent : StoryComponent

This class represents the Quiz component.

  • Type of the component

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

    @objc
    public let options: [String]
  • Index of the right answer if exists

    Declaration

    Swift

    @objc
    public let rightAnswerIndex: NSNumber?
  • Option index that the user selected

    Declaration

    Swift

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

    Declaration

    Swift

    @objc
    public let customPayload: String?
  • StoryQuizComponent initialization

    Declaration

    Swift

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

    Parameters

    title

    Title of the quiz if exists

    options

    List of options in the quiz

    rightAnswerIndex

    Index of the right answer if exists

    selectedOptionIndex

    Option index that the user selected

    customPayload

    Custom payload for this quiz if exists