Class

iOSTableRowAction


Warning

This item was deprecated in version 2020r2. Please use iOSMobileTableRowAction as a replacement.

Description

An iOSTableRowAction represents a single action that a user can take when swiping horizontally on an iOSTable row. Multiple actions may be added. As of iOS 8 an action is presented as a button near the trailing edge of the row. This class is used in conjunction with the iOSTable.ActionsForRow event.

Properties

Name

Type

Read-Only

Shared

Handle

Ptr

Style

Styles

Tag

Auto

Title

Text

Methods

Name

Parameters

Returns

Shared

Constructor

style As iOSTableRowAction, title As String, Optional tag As Variant

Enumerations

iOSTableRowAction.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


iOSTableRowAction.Handle

Handle As Ptr

Used for creating Declares to the underlying UITableViewRowAction object.

This property is read-only.


iOSTableRowAction.Style

Style As Styles

A value from the Styles enum to indicate how the row action displays.

This property is read-only.


iOSTableRowAction.Tag

Tag As Auto

A value to associate with the action. This value will be passed into the iOSTable event and allows you to determine which action was selected. As an Auto, there are no limitations on the value you supply.


iOSTableRowAction.Title

Title As Text

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

Method descriptions


iOSTableRowAction.Constructor

Constructor(style As iOSTableRowAction, title As String, Optional tag As Variant)

Note

Constructors are special methods called when you create an object with the New keyword and pass in the parameters above.

Create a new row action that can be returned in iOSTable.

Creates a single action to delete a row (code in in iOSTable.ActionsForRow event):

Var actions(0) As iOSTableRowAction
' Create the Delete button
actions(0) = New iOSTableRowAction(iOSTableRowAction.Styles.Destructive, "Delete", "Delete")
Return actions

Notes

Row actions only work for tables that use iOSMobileTableDataSourceEditing and where its AllowRowEditing method returns True.

Sample code

This class is used in the iOSTable event to set up the actions. The iOSTable event is called when an action is used. This is how you would set it up in the iOSMobileTable events:

Event ActionsForRow(section As Integer, row As Integer) As iOSTableRowActions()
  Var actions(1) As iOSTableRowAction
  ' Create the More button
  actions(0) = New iOSTableRowAction(iOSTableRowAction.Styles.Normal, "More...", "More")
  ' Create the Delete button
  actions(1) = New iOSTableRowAction(iOSTableRowAction.Styles.Destructive, "Delete", "Delete")
  Return actions
End Event

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

Compatibility

iOS projects on the iOS operating system.

See also

Object parent class; iOSMobileTable