<div class="meta" robots="noindex">

</div>

Class

# iOSMessageBox

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2020r2. Please use `MobileMessageBox</api/user_interface/mobile/mobilemessagebox>` as a replacement.

</div>

## Description

Used to asynchronously display alerts.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                             | Type                         | Read-Only | Shared |
|----------------------------------|------------------------------|-----------|--------|
| `Message<iosmessagebox.message>` | `Text</api/deprecated/text>` |           |        |
| `Title<iosmessagebox.title>`     | `Text</api/deprecated/text>` |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                       | Parameters | Returns | Shared |
|----------------------------|------------|---------|--------|
| `Show<iosmessagebox.show>` |            |         |        |

## Events

<div class="rst-class">

table-centered_column_4

</div>

| Name                                       | Parameters                                        | Returns |
|--------------------------------------------|---------------------------------------------------|---------|
| `ButtonAction<iosmessagebox.buttonaction>` | buttonIndex As `Integer</api/data_types/integer>` |         |

## Property descriptions

<div id="iosmessagebox.message">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSMessageBox.Message

**Message** As `Text</api/deprecated/text>`

A longer message that appears below the title in the message box.

Set the message:

``` xojo
MessageBox1.Message = "Would you like to update this information?"
```

<div id="iosmessagebox.title">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSMessageBox.Title

**Title** As `Text</api/deprecated/text>`

The title of the message box, which appears at the top.

Set the title:

``` xojo
MessageBox1.Title = "Warning"
```

## Method descriptions

<div id="iosmessagebox.show">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSMessageBox.Show

**Show**

Displays the message box. This is not modal, so your code continues to run. When the user selects a button, the ButtonAction event handler is called.

Displays a message box. HelloMessage is an <span class="title-ref">iOSMessageBox</span> that was dragged onto the View from the Library:

``` xojo
HelloMessage.Title = "Hello"
HelloMessage.Message = "Hello, World!"
HelloMessage.Show ' Not modal, so code does not pause here
```

## Event descriptions

<div id="iosmessagebox.buttonaction">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSMessageBox.ButtonAction

**ButtonAction**(buttonIndex As `Integer</api/data_types/integer>`)

Called when the button at buttonIndex (0-based) is selected.

Displays the index of the selected button:

``` xojo
Label1.Text = "You selected button " + buttonIndex.ToText
```

## Notes

Since <span class="title-ref">iOSMessageBox</span> is asynchronous, any code after the Show method is executed after the message box is displayed. Use the ButtonAction event handler to get the results of a button selection and to run code based on the selection. Here are Apple's UI guidelines for the text and buttons in a MessageBox:

[iOS Human Interface Guidelines: Temporary Views](https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/Alerts.html)

## Compatibility

iOS projects on the iOS operating system.
