GCKUICastButton Class
Stay organized with collections
Save and categorize content based on your preferences.
A subclass of UIButton that implements a "Cast" button.
- Since
- 3.0
Inherits UIButton.
|
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...
|
|
- (instancetype) initWithCoder: |
|
(NSCoder *) |
decoder |
|
- (instancetype) initWithFrame: |
|
(CGRect) |
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.
- (BOOL) triggersDefaultCastDialog |
|
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.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[null,null,["Last updated 2024-09-18 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eGCKUICastButton\u003c/code\u003e is a subclass of \u003ccode\u003eUIButton\u003c/code\u003e that provides a pre-built "Cast" button for iOS applications.\u003c/p\u003e\n"],["\u003cp\u003eIt offers customization options for icons representing active, inactive, and animated states, ensuring visual alignment with the app's design.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can manage the button's accessibility labels to enhance usability for users with disabilities.\u003c/p\u003e\n"],["\u003cp\u003eWhile it defaults to triggering the Cast dialog, this behavior can be overridden to allow custom touch event handling within the application.\u003c/p\u003e\n"],["\u003cp\u003eThis class simplifies Cast integration by providing a ready-made UI element and handling the display of the standard Cast dialog.\u003c/p\u003e\n"]]],[],null,["# GCKUICastButton Class\n\n[Instance Methods](#pub-methods) \\| [Properties](#properties) \nGCKUICastButton Class Reference \n\nOverview\n--------\n\nA subclass of [**UIButton**](https://goo.gl/VK61wU) that implements a \"Cast\" button.\n\nSince\n: 3.0\n\nInherits UIButton.\n\n|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Instance Method Summary ----------------------- ||\n| (instancetype) | - [initWithCoder:](/cast/v3/reference/ios/interface_g_c_k_u_i_cast_button#a23413a39b3e6a8b12834d34c68f74445) |\n| | Constructs a new [GCKUICastButton](/cast/v3/reference/ios/interface_g_c_k_u_i_cast_button \"A subclass of UIButton that implements a \\\"Cast\\\" button. \") using the given decoder. [More...](#a23413a39b3e6a8b12834d34c68f74445) |\n| ||\n| (instancetype) | - [initWithFrame:](/cast/v3/reference/ios/interface_g_c_k_u_i_cast_button#a79e5ad64b3c53b6dbc14defda46429d3) |\n| | Constructs a new [GCKUICastButton](/cast/v3/reference/ios/interface_g_c_k_u_i_cast_button \"A subclass of UIButton that implements a \\\"Cast\\\" button. \") with the given frame. [More...](#a79e5ad64b3c53b6dbc14defda46429d3) |\n| ||\n| (void) | - [setInactiveIcon:activeIcon:animationIcons:](/cast/v3/reference/ios/interface_g_c_k_u_i_cast_button#aeb7e7925cdbcf8e553dd51bf0abcadc7) |\n| | Sets the icons for the active, inactive, and animated states of the button. [More...](#aeb7e7925cdbcf8e553dd51bf0abcadc7) |\n| ||\n| (void) | - [setAccessibilityLabel:forCastState:](/cast/v3/reference/ios/interface_g_c_k_u_i_cast_button#af6cad96ec86d102ad38a0ce3b27669d3) |\n| | Sets the accessibility label for the cast states of the button. [More...](#af6cad96ec86d102ad38a0ce3b27669d3) |\n| ||\n\n|------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Property Summary ---------------- ||\n| BOOL | [triggersDefaultCastDialog](/cast/v3/reference/ios/interface_g_c_k_u_i_cast_button#aa0f22a89c101e9d6c4b233e72ddf815c) |\n| | 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...](#aa0f22a89c101e9d6c4b233e72ddf815c) |\n| ||\n\nMethod Detail\n-------------\n\n|---------------------------------|---|--------------|-----------|---|\n| - (instancetype) initWithCoder: | | (NSCoder \\*) | *decoder* | |\n\nConstructs a new [GCKUICastButton](/cast/v3/reference/ios/interface_g_c_k_u_i_cast_button \"A subclass of UIButton that implements a \\\"Cast\\\" button. \") using the given decoder. \n\n|---------------------------------|---|----------|---------|---|\n| - (instancetype) initWithFrame: | | (CGRect) | *frame* | |\n\nConstructs a new [GCKUICastButton](/cast/v3/reference/ios/interface_g_c_k_u_i_cast_button \"A subclass of UIButton that implements a \\\"Cast\\\" button. \") with the given frame. \n\n|---------------------------|---|------------------------------|------------------|\n| - (void) setInactiveIcon: | | (UIImage \\*) | *inactiveIcon* |\n| activeIcon: | | (UIImage \\*) | *activeIcon* |\n| animationIcons: | | (NSArray\\\u003c UIImage \\* \\\u003e \\*) | *animationIcons* |\n| | | | |\n\nSets the icons for the active, inactive, and animated states of the button.\n\nThe 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. \n\n|---------------------------------|---|--------------------------------------------------------------------------------------------|---------|\n| - (void) setAccessibilityLabel: | | (NSString \\*) | *label* |\n| forCastState: | | ([GCKCastState](/cast/v3/reference/ios/g_c_k_common_8h#af0c098ac6b7bff89f13f0bad7b88a5b5)) | *state* |\n| | | | |\n\nSets the accessibility label for the cast states of the button.\n\nThis is the recommended way to set accessibility label for the button. Label set by setAccessibilityLabel: is applied to all cast states.\n\nProperty Detail\n---------------\n\n|-------------------------------------------------------------------------------|--------------------------|\n| |------------------------------------| | - (BOOL) triggersDefaultCastDialog | | readwritenonatomicassign |\n\nA flag that indicates whether a touch event on this button will trigger the display of the Cast dialog that is provided by the framework.\n\nBy 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."]]