# GCKUIButton Class

[Instance Methods](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_u_i_button#pub-methods) \| [Properties](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_u_i_button#properties) GCKUIButton Class Reference

## Overview

A subclass of [**UIButton**](https://goo.gl/VK61wU) that supports custom application states.

These states are ORed onto the value of the button's **state** property to provide additional, application-specific states. Images can be assigned to these custom states, for example:
\[button setImage:\[UIImage imageNamed:@"myCustomStateImage"\] forState:(UIControlStateNormal \| kMyControlStateCustom)\];

Application state values must only use the bits that are set in the [**UIControlStateApplication**](https://goo.gl/tZWsqZ) bitmask.

**[Deprecated:](https://developers.google.com/cast/docs/reference/ios/deprecated#_deprecated000040)**
:   Use [GCKUIMultistateButton](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_u_i_multistate_button "A subclass of UIButton that supports multiple states. ").

    Since
    :   3.0

Inherits [GCKUIMultistateButton](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_u_i_multistate_button).

|---|---|
| ## Instance Method Summary ||
| (void) | - [setImage:forButtonState:](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_u_i_multistate_button#afa6a9b60ccbe99ae3dd6fdd1f92225e3) |
|   | Sets the image to display for a given button state. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_u_i_button#afa6a9b60ccbe99ae3dd6fdd1f92225e3) |
|   ||

|---|---|
| ## Property Summary ||
| UIControlState | [applicationState](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_u_i_button#a1457e5e718738775b004a167c8591426) |
|   | The button's application state. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_u_i_button#a1457e5e718738775b004a167c8591426) |
|   ||
| NSUInteger | [buttonState](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_u_i_multistate_button#a51dc394e64d3837d6bffcad409f3f0f4) |
|   | The button's application state. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_u_i_button#a51dc394e64d3837d6bffcad409f3f0f4) |
|   ||

## Method Detail

|---|---|---|---|
| - (void) setImage: |   | (UIImage \*) | *image* |
| forButtonState: |   | (NSUInteger) | *buttonState* |
|   |   |   |   |

Sets the image to display for a given button state.

Parameters
:

    |---|---|
    | image | The image. |
    | buttonState | The button state. |


## Property Detail

|---|---|
| |---| | - (UIControlState) applicationState | | readwritenonatomicassign |

The button's application state.

This state is ORed onto the button's existing state.

|---|---|
| |---| | - (NSUInteger) buttonState | | readwritenonatomicassigninherited |

The button's application state.