AI-generated Key Takeaways
-
GCKUIMediaButtonBarProtocol is a delegate protocol for customizing media button bars.
-
It allows getting the maximum number of customizable buttons using
buttonCount. -
Buttons can be configured with predefined types or custom UIButtons at specific indices using
setButtonType:atIndex:andsetCustomButton:atIndex:. -
The current type and reference to a custom button at a given position can be retrieved using
buttonTypeAtIndex:andcustomButtonAtIndex:. -
This protocol is inherited by
GCKUIExpandedMediaControlsViewControllerandGCKUIMiniMediaControlsViewController.
Overview
The GCKUIMediaButtonBarProtocol delegate protocol.
- Since
- 3.1
Inherits <NSObject>.
Inherited by GCKUIExpandedMediaControlsViewController, and GCKUIMiniMediaControlsViewController.
Instance Method Summary | |
| (NSUInteger) | - buttonCount |
| The maximum number of buttons that can be customized by the receiver. More... | |
| (void) | - setButtonType:atIndex: |
Sets the button type for the button at position index. More... | |
| (GCKUIMediaButtonType) | - buttonTypeAtIndex: |
| Returns the current type of button at a given position. More... | |
| (void) | - setCustomButton:atIndex: |
| Sets the instance of UIButton that should be presented at a given button position. More... | |
| (UIButton *__nullable) | - customButtonAtIndex: |
| Returns a reference to the custom button at a given position. More... | |
Method Detail
| - (NSUInteger) buttonCount |
The maximum number of buttons that can be customized by the receiver.
- Returns
- Number of buttons.
| - (void) setButtonType: | (GCKUIMediaButtonType) | buttonType | |
| atIndex: | (NSUInteger) | index | |
Sets the button type for the button at position index.
- Parameters
-
buttonType The type of the button. If the type is GCKUIMediaButtonTypeCustom, a UIButton instance should be passed for the same index using setCustomButton:atIndex:. Otherwise a default button is created and presented in that position. index The position in which the button should be presented. 0 is the left-most position. Indices should be smaller than the value returned by buttonCount.
| - (GCKUIMediaButtonType) buttonTypeAtIndex: | (NSUInteger) | index |
Returns the current type of button at a given position.
- Parameters
-
index The button's position, where 0 is the left-most position.
- Returns
- The type of the button at the selected position.
| - (void) setCustomButton: | (UIButton *__nullable) | customButton | |
| atIndex: | (NSUInteger) | index | |
Sets the instance of UIButton that should be presented at a given button position.
- Parameters
-
customButton The button instance to be presented in the control bar. index The position in which the button should be presented. 0 is the left-most position. Indices should be smaller than the value returned by buttonCount.
| - (UIButton *__nullable) customButtonAtIndex: | (NSUInteger) | index |
Returns a reference to the custom button at a given position.
- Parameters
-
index The button's position, where 0 is the right-most position.
- Returns
- A reference to the button at the selected position, or
nilif there is no custom button at that position, or the position is invalid.