# &lt;GCKUICastButtonDelegate&gt; Protocol

[Instance Methods](https://developers.google.com/cast/docs/reference/ios/protocol_g_c_k_u_i_cast_button_delegate-p#pub-methods) \<GCKUICastButtonDelegate\> Protocol Reference

## Overview

Use the methods of this protocol to present custom dialog in response to user action.

Since
:   4.6.0

Inherits \<UIButtonNSObject\>.

|---|---|
| ## Instance Method Summary ||
| (void) | - [castButtonDidTapToPresentLocalNetworkAccessPermissionDialog:](https://developers.google.com/cast/docs/reference/ios/protocol_g_c_k_u_i_cast_button_delegate-p#ac6aa5433a7e11672e979ee1d9c1cf800) |
|   | Tells the delegate that the cast button is tapped by the user for the first time on iOS14 or above and cast devices discovery has not started in the current or previous app sessions. [More...](https://developers.google.com/cast/docs/reference/ios/protocol_g_c_k_u_i_cast_button_delegate-p#ac6aa5433a7e11672e979ee1d9c1cf800) |
|   ||
| (void) | - [castButtonDidTap:toPresentDialogForCastState:](https://developers.google.com/cast/docs/reference/ios/protocol_g_c_k_u_i_cast_button_delegate-p#ac814e37993fa52f64de3334c92676bd4) |
|   | Tells the delegate that the cast button is tapped by the user after the discovery has been initiated in current or previous app session. [More...](https://developers.google.com/cast/docs/reference/ios/protocol_g_c_k_u_i_cast_button_delegate-p#ac814e37993fa52f64de3334c92676bd4) |
|   ||

## Method Detail

|---|---|
| |---|---|---|---|---| | - (void) castButtonDidTapToPresentLocalNetworkAccessPermissionDialog: |   | ([GCKUICastButton](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_u_i_cast_button) \*) | *castButton* |   | | optional |

Tells the delegate that the cast button is tapped by the user for the first time on iOS14 or above and cast devices discovery has not started in the current or previous app sessions.

Implement this method to present the custom dialog. If not implmemented, the default dialog is presented.

Parameters
:

    |---|---|
    | castButton | Instance of `https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_u_i_cast_button` tapped. |


|---|---|
| |---|---|---|---| | - (void) castButtonDidTap: |   | ([GCKUICastButton](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_u_i_cast_button) \*) | *castButton* | | toPresentDialogForCastState: |   | (GCKCastState) | *castState* | |   |   |   |   | | optional |

Tells the delegate that the cast button is tapped by the user after the discovery has been initiated in current or previous app session.

Implement this method to present the custom dialog as per the cast state. Observe [GCKCastContext::castState](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_cast_context#a41a8b6a12d778a4ea763b0b7d1141c54 "The current casting state for the application. ") to update the dialog dynamically as per changes in the cast state. If not implmemented, the default dialog is presented.

Parameters
:

    |---|---|
    | castButton | Instance of `https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_u_i_cast_button` tapped. |
    | castState | Cast state when the cast button is tapped. |