BlazeMomentsPlayerButtonsStyle - iOS
The BlazeMomentsPlayerButtonsStyle struct represents the configuration for the moment buttons.
Properties
mute
var mute: BlazeMomentsPlayerButtonStyleThe mute button configuration.
exit
var exit: BlazeMomentsPlayerButtonStyleThe exit button configuration.
share
var share: BlazeMomentsPlayerButtonStyleThe share button configuration.
like
var like: BlazeMomentsPlayerButtonStyleThe like button configuration.
play
var play: BlazeMomentsPlayerButtonStyleThe play button configuration.
captions
var captions: BlazeStoryPlayerButtonStyleThe captions button style.
seekForward
var seekForward: BlazeMomentsPlayerButtonStyleThe seek forward button configuration.
seekBackward
var seekBackward: BlazeMomentsPlayerButtonStyleThe seek backward button configuration.
search
var search: BlazeMomentsPlayerButtonStyleThe search button configuration.
shouldPreserveLikesCountBelowThreshold
var shouldPreserveLikesCountBelowThreshold: BoolControls whether the space below the like button is preserved when the likes count is hidden because it is below the display threshold.
When true, the likes count label remains invisible but occupies its layout space, preventing the buttons from shifting. When false, the container collapses to the button height.
The display threshold for the likes count is configured server-side. Defaults to true.
bottomStackOrder
var bottomStackOrder: [BottomStackButtons]The current order of buttons in the bottom stack (top to bottom).
This property cannot be set directly. Use setBottomStackOrder to update the order.
setBottomStackOrder
Updates the order of buttons in the bottom stack, ensuring validation and preserving the relative positions of buttons that were not provided.
-
Parameters:
- newOrder: An array of
BottomStackButtonsthat specifies the desired order of buttons.
- newOrder: An array of
-
Important Considerations:
- This method reorders only the buttons provided in the
newOrderarray. - 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.
- This method reorders only the buttons provided in the
Example with Colors:
Default order: Red, Green, Blue, Yellow, Black
-
Case 1: Providing only a partial order (e.g.,
setBottomStackOrder([.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.,
setBottomStackOrder([.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.,
setBottomStackOrder([.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.,
setBottomStackOrder([.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.
mutating func setBottomStackOrder(_ newOrder: [BottomStackButtons])bottomStackCustomActionButtons
public private(set) var bottomStackCustomActionButtons: [BlazeMomentsPlayerCustomActionButton]A list of custom action buttons that can be added to the moments player
This property cannot be set directly. Use setBottomStackCustomActionButtons to update the order.
setBottomStackCustomActionButtons
customActionButtons will be from top to bottom in the order they were added unless you specified a custom order using setBottomStackOrder
This method will override the current custom action buttons list.
public mutating func setBottomStackCustomActionButtons(_ customActionButtons: [BlazeMomentsPlayerCustomActionButton])Enums
BottomStackButtons
| Value |
|---|
| like |
| share |
| captions |
| customAction(id: String) |
Updated 11 days ago
