AI-generated Key Takeaways
-
GCKUICastButton is a subclass of UIButton used to implement a "Cast" button.
-
It can be initialized using a decoder or with a specified frame.
-
You can customize the icons for the active, inactive, and animated states of the button.
-
Accessibility labels can be set for different cast states of the button.
-
The triggersDefaultCastDialog property determines if touching the button displays the default Cast dialog.
Overview
A subclass of UIButton that implements a "Cast" button.
- Since
- 3.0
Inherits UIButton.
Instance Method Summary | |
| (instancetype) | - initWithCoder: |
| Constructs a new GCKUICastButton using the given decoder. More... | |
| (instancetype) | - initWithFrame: |
| Constructs a new GCKUICastButton with the given frame. More... | |
| (void) | - setInactiveIcon:activeIcon:animationIcons: |
| Sets the icons for the active, inactive, and animated states of the button. More... | |
| (void) | - setAccessibilityLabel:forCastState: |
| Sets the accessibility label for the cast states of the button. More... | |
Property Summary | |
| BOOL | triggersDefaultCastDialog |
| A flag that indicates whether a touch event on this button will trigger the display of the Cast dialog that is provided by the framework. More... | |
Method Detail
| - (instancetype) initWithCoder: | (NSCoder *) | decoder |
Constructs a new GCKUICastButton using the given decoder.
| - (instancetype) initWithFrame: | (CGRect) | frame |
Constructs a new GCKUICastButton with the given frame.
| - (void) setInactiveIcon: | (UIImage *) | inactiveIcon | |
| activeIcon: | (UIImage *) | activeIcon | |
| animationIcons: | (NSArray< UIImage * > *) | animationIcons | |
Sets the icons for the active, inactive, and animated states of the button.
The supplied images should all be single-color with a transparent background. The color of the images is not significant, as the button's tint color (tintColor property) determines the color that they are rendered in.
| - (void) setAccessibilityLabel: | (NSString *) | label | |
| forCastState: | (GCKCastState) | state | |
Sets the accessibility label for the cast states of the button.
This is the recommended way to set accessibility label for the button. Label set by setAccessibilityLabel: is applied to all cast states.
Property Detail
|
readwritenonatomicassign |
A flag that indicates whether a touch event on this button will trigger the display of the Cast dialog that is provided by the framework.
By default this property is set to YES. If an application wishes to handle touch events itself, it should set the property to NO and register an appropriate target and action for the touch event.