Class

# iOSMobileTableRowAction

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

## Description

An <span class="title-ref">iOSMobileTableRowAction</span> represents a single action that a user can take when swiping horizontally on an `iOSMobileTable</api/ios/iosmobiletable>` row. Multiple actions may be added. This class is used in conjunction with the `iOSMobileTable.ApplyActionsForRow<iosmobiletable.applyactionsforrow>` and `iOSMobileTable.ApplyLeadingActionsForRow<iosmobiletable.applyleadingactionsforrow>` events.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                                                   | Type                                        | Read-Only | Shared |
|------------------------------------------------------------------------|---------------------------------------------|-----------|--------|
| `AllowMulticolorSymbol<iosmobiletablerowaction.allowmulticolorsymbol>` | `Boolean</api/data_types/boolean>`          |           |        |
| `BackgroundColor<iosmobiletablerowaction.backgroundcolor>`             | `Color</api/data_types/color>`              |           |        |
| `Handle<iosmobiletablerowaction.handle>`                               | `Ptr</api/data_types/additional_types/ptr>` | ✓         |        |
| `Image<iosmobiletablerowaction.image>`                                 | `Picture</api/graphics/picture>`            |           |        |
| `Style<iosmobiletablerowaction.style>`                                 | `Styles<iosmobiletablerowaction.styles>`    | ✓         |        |
| `Symbol<iosmobiletablerowaction.symbol>`                               | `String</api/data_types/string>`            |           |        |
| `Tag<iosmobiletablerowaction.tag>`                                     | `Variant</api/data_types/variant>`          |           |        |
| `Title<iosmobiletablerowaction.title>`                                 | `String</api/data_types/string>`            |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                                | Parameters                                                                                                                                                                                         | Returns | Shared |
|-----------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|--------|
| `Constructor<iosmobiletablerowaction.constructor0>` | style As `iOSMobileTableRowAction.Styles<iosmobiletablerowaction.styles>`, title As `String</api/data_types/string>`, `Optional</api/language/optional>` tag As `Variant</api/data_types/variant>` |         |        |

## Enumerations

<div id="iosmobiletablerowaction.styles">

<div class="rst-class">

forsearch

</div>

</div>

iOSMobileTableRowAction.Styles

### Styles

> A style describes the conceptual role of the action. Destructive, in this context, means actions like deleting a user's data. Normal represents other non-destructive actions. (Normal, Destructive)
>
> | Enum        | Description                                                                                                                                                            |
> |-------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
> | Destructive | Apply a style that indicates that the action might change or delete data. This style changes the background to an appropriate value to reflect the destructive action. |
> | Normal      | Apply a style that reflects standard non-destructive actions.                                                                                                          |

## Property descriptions

<div id="iosmobiletablerowaction.allowmulticolorsymbol">

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

</div>

<div class="rst-class">

forsearch

</div>

iOSMobileTableRowAction.AllowMulticolorSymbol

**AllowMulticolorSymbol** As `Boolean</api/data_types/boolean>`

> Allows to use multicolored version of the symbol when it is set to `True</api/language/true>`. If there is no multicolored version available, it will default to monochrome.

<div id="iosmobiletablerowaction.backgroundcolor">

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

</div>

<div class="rst-class">

forsearch

</div>

iOSMobileTableRowAction.BackgroundColor

**BackgroundColor** As `Color</api/data_types/color>`

> The background `color</api/data_types/color>` for the action.

<div id="iosmobiletablerowaction.handle">

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

</div>

<div class="rst-class">

forsearch

</div>

iOSMobileTableRowAction.Handle

**Handle** As `Ptr</api/data_types/additional_types/ptr>`

> Used for creating Declares to the underlying UITableViewRowAction object.
>
> This property is read-only.

<div id="iosmobiletablerowaction.image">

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

</div>

<div class="rst-class">

forsearch

</div>

iOSMobileTableRowAction.Image

**Image** As `Picture</api/graphics/picture>`

> The image associated with the action.

<div id="iosmobiletablerowaction.style">

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

</div>

<div class="rst-class">

forsearch

</div>

iOSMobileTableRowAction.Style

**Style** As `Styles<iosmobiletablerowaction.styles>`

> A value from the Styles enum to indicate how the row action displays.
>
> This property is read-only.

<div id="iosmobiletablerowaction.symbol">

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

</div>

<div class="rst-class">

forsearch

</div>

iOSMobileTableRowAction.Symbol

**Symbol** As `String</api/data_types/string>`

> Allows setting the symbol name(s) to be used as the icon for the <span class="title-ref">iOSMobileTableRowAction</span>. If none is found it sets the assigned Picture from the Icon property. If any is found, then it sets this as the image instead of the Picture set on the Icon property.
>
> The list of supported symbols can be found here:
>
> - **macOS**: <https://developer.apple.com/design/human-interface-guidelines/sf-symbols>

<div id="iosmobiletablerowaction.tag">

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

</div>

<div class="rst-class">

forsearch

</div>

iOSMobileTableRowAction.Tag

**Tag** As `Variant</api/data_types/variant>`

> A value to associate with the action. This value will be passed into the `iOSMobileTable.RowActionSelected<iosmobiletable.rowactionselected>` event and allows you to determine which action was selected. As a `Variant</api/data_types/variant>`, there are no limitations on the value you supply.

<div id="iosmobiletablerowaction.title">

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

</div>

<div class="rst-class">

forsearch

</div>

iOSMobileTableRowAction.Title

**Title** As `String</api/data_types/string>`

> The title of the button. This is displayed to the user and therefore should be localized.

## Method descriptions

<div id="iosmobiletablerowaction.constructor0">

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

</div>

<div class="rst-class">

forsearch

</div>

iOSMobileTableRowAction.Constructor

**Constructor**(style As `iOSMobileTableRowAction.Styles<iosmobiletablerowaction.styles>`, title As `String</api/data_types/string>`, `Optional</api/language/optional>` tag As `Variant</api/data_types/variant>`)

> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> `Constructors</api/language/constructor>` are special methods called when you create an object with the `New</api/language/new>` keyword and pass in the parameters above.
>
> </div>
>
> Create a new row action that can be returned in `iOSMobileTable.ApplyActionsForRow<iosmobiletable.applyactionsforrow>` or `iOSMobileTable.ApplyLeadingActionsForRow<iosmobiletable.applyleadingactionsforrow>`.
>
> Creates a single action to delete a row (code in `iOSMobileTable.ApplyActionsForRow<iosmobiletable.applyactionsforrow>` or `iOSMobileTable.ApplyLeadingActionsForRow<iosmobiletable.applyleadingactionsforrow>` event):
>
> ``` xojo
> Var actions(0) As iOSMobileTableRowAction
> ' Create the Delete button
> actions(0) = New iOSMobileTableRowAction(iOSMobileTableRowAction.Styles.Destructive, "Delete", "Delete")
> Return actions
> ```

## Notes

Row actions only work for tables that use `iOSMobileTableDataSourceEditing</api/ios/iosmobiletabledatasourceediting>` and where its `AllowRowEditing<iosmobiletabledatasourceediting.allowrowediting>` method returns `True</api/language/true>`.

## Sample code

This class is used in the `iOSMobileTable.ApplyActionsForRow<iosmobiletable.applyactionsforrow>` and `iOSMobileTable.ApplyLeadingActionsForRow<iosmobiletable.applyleadingactionsforrow>` events to set up the actions. The `iOSMobileTable.RowActionSelected<iosmobiletable.rowactionselected>` event is called when an action is used. This is how you would set it up in the `iOSMobileTable</api/ios/iosmobiletable>` events:

``` xojo
Event ApplyActionsForRow(section As Integer, row As Integer) As iOSMobileTableRowAction()
  Var actions(1) As iOSMobileTableRowAction
  ' Create the More button
  actions(0) = New iOSMobileTableRowAction(iOSMobileTableRowAction.Styles.Normal, "More...", "More")
  ' Create the Delete button
  actions(1) = New iOSMobileTableRowAction(iOSMobileTableRowAction.Styles.Destructive, "Delete", "Delete")
  Return actions
End Event

Event RowActionSelected(section As Integer, row As Integer, actionTag As Variant)
  Select Case actionTag
  Case "More"
    ' ... show more info
  Case "Delete"
    ' ... delete something
  End Select
End Event
```

## Compatibility

|                       |        |
|-----------------------|--------|
| **Project Types**     | Mobile |
| **Operating Systems** | iOS    |

<div class="seealso">

`Object</api/data_types/additional_types/object>` parent class; `iOSMobileTable</api/ios/iosmobiletable>` class.

</div>
