<GCKUICastButtonDelegate> 协议
使用此协议的方法显示自定义对话框来响应用户操作。
- 开始时间
- 4.6.0
继承 <UIButtonNSObject>。
- (void) castButtonDidTapToPresentLocalNetworkAccessPermissionDialog: |
|
(GCKUICastButton *) |
castButton |
|
|
optional |
告知受托人,在 iOS14 或更高版本上,用户首次点按投射按钮,且投射设备发现未在当前或以前的应用会话中启动。
实现此方法以显示自定义对话框。如果未实现,系统会显示默认对话框。
- Parameters
-
- (void) castButtonDidTap: |
|
(GCKUICastButton *) |
castButton |
toPresentDialogForCastState: |
|
(GCKCastState) |
castState |
|
|
| |
|
optional |
告知委托,在当前或上一个应用会话中发起发现后,用户点按了投射按钮。
实现此方法以根据投射状态显示自定义对话框。观察 GCKCastContext::castState,以根据投射状态的变化动态更新对话框。如果未实现,系统会显示默认对话框。
- Parameters
-
castButton | Instance of GCKUICastButton tapped. |
castState | Cast state when the cast button is tapped. |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2023-12-01。
[null,null,["最后更新时间 (UTC):2023-12-01。"],[[["The `GCKUICastButtonDelegate` protocol allows developers to present custom dialogs in response to user interactions with the Cast button."],["It provides two optional methods: `castButtonDidTapToPresentLocalNetworkAccessPermissionDialog:` and `castButtonDidTap:toPresentDialogForCastState:`."],["`castButtonDidTapToPresentLocalNetworkAccessPermissionDialog:` is called the first time the Cast button is tapped on iOS 14 or later, before device discovery has begun."],["`castButtonDidTap:toPresentDialogForCastState:` is called on subsequent taps of the Cast button, after device discovery has started, allowing for custom dialogs based on the current cast state."],["If these methods are not implemented, default dialogs will be presented."]]],[]]