GuidesAPI ReferenceRelease Notes
HomeLog InHome
Guides

BlazeStoryPlayerButtonsStyle - iOS

The BlazeStoryPlayerButtonsStyle struct represents the configuration for the story buttons within a Blaze story player

Properties

mute

var mute: BlazeStoryPlayerButtonStyle

The mute button style.

exit

var exit: BlazeStoryPlayerButtonStyle

The exit button style.

share

var share: BlazeStoryPlayerButtonStyle

The share button style.

captions

var captions: BlazeStoryPlayerButtonStyle

The captions button style.

topStackOrder

public private(set) var topStackOrder: [TopStackButtons]

The current order of buttons in the top stack (top to bottom).
This property cannot be set directly. Use setTopStackOrder to update the order.

setTopStackOrder

Updates the order of buttons in the top stack, ensuring validation and preserving the relative positions of buttons that were not provided.

  • Parameters:

    • newOrder: An array of TopStackButtons that specifies the desired order of buttons.
  • Important Considerations:

    • This method reorders only the buttons provided in the newOrder array.
    • Any buttons not included will stay in their default positions.
    • Validation: This method ensures there are no duplicate buttons, and all buttons are valid.
    • If any required buttons are missing from the newOrder, they will retain their original default order.

Example with Colors:

Default order: Red, Green, Blue, Yellow, Black

  • Case 1: Providing only a partial order (e.g., setTopStackOrder([.blue, .green]))

    • Resulting order: Red, Blue, Green, Yellow, Black
    • Explanation:
      • Red stays at the top (since it wasn't provided).
      • Blue and Green are reordered based on the input.
      • Yellow and Black remain in their original positions.
  • Case 2: Providing a partial order with a different sequence (e.g., setTopStackOrder([.yellow, .blue, .green]))

    • Resulting order: Red, Yellow, Blue, Green, Black
    • Explanation:
      • Red stays in its original position.
      • Yellow, Blue, and Green are reordered as per the input.
      • Black stays at the bottom.
  • Case 3: Providing a full custom order (e.g., setTopStackOrder([.black, .yellow, .red, .blue, .green]))

    • Resulting order: Black, Yellow, Red, Blue, Green
    • Explanation:
      • Since all buttons were provided in the input, they are reordered exactly as requested.
  • Case 4: Providing only one button (e.g., setTopStackOrder([.yellow]))

    • Resulting order: Red, Green, Blue, Yellow, Black
    • Explanation:
      • Yellow is set at its position, and all other buttons remain in their default positions.
  • Throws: A fatal error if the order contains duplicates or invalid button types.

public mutating func setTopStackOrder(_ newOrder: [TopStackButtons])

topStackCustomActionButtons

public private(set) var topStackCustomActionButtons: [BlazeStoryPlayerCustomActionButton]

A list of custom action buttons that can be added to the stories player
This property cannot be set directly. Use setTopStackCustomActionButtons to update the order.

setTopStackCustomActionButtons

customActionButtons will be from top to bottom in the order they were added unless you specified a custom order using setTopStackOrder
This method will override the current custom action buttons list.

public mutating func setTopStackCustomActionButtons(_ customActionButtons: [BlazeStoryPlayerCustomActionButton])

Enums

TopStackButtons

Value
exit
mute
share
captions
customAction(id: String)

Did this page help you?