TableViewRowAction


super: Object

A single action to present when the user swipes horizontally in a table row.

Events

  • Load() This event is called when the object becames available in the current runtime system.

  • Action(cell: TableViewCell, section: Int, index: Int) This event is called in response to the selection of the row action

  • Unload() This event is called when the object has been removed from the current runtime system (but not yet deallocated).

Properties

  • var style: TableViewRowActionStyle Destructive (default) or normal style. (read-only)

  • var title: String Title of the button.

  • var image: Image The image to display in the button. Only available on iOS 11.0+

  • var backgroundColor: Color The background color for the action button. The default color depends on the style.

  • var objectName: String The name of the object.

Constructors

Enums

TableViewRowActionStyle

  • .Default
  • .Destructive
  • .Normal

Examples

// How to programmatically add a create a new TableViewRowAction:

// create the new row action with a style and a title
var newAction = TableViewRowAction(TableViewRowActionStyle.Destructive,"Title");

// if you want to set an image to be shown instead of the title
// only available on iOS 11.0 or higher
// newAction.image = // you image here;

// add the closure that will be called if the action is selected
var closure = func(TableViewCell, section, index) { 
    // your code here
    Console.write("newAction \(index)");    
} 
newAction.bind("Action",closure);

// add the new action to the cell array of actions (left o right)
cell.leftActions = [newAction];