Interface

# iOSMobileTableDataSourceEditing

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

## Description

A data source to use to enable editing of iOSMobileTable data. When a table is put into "edit mode", the user can use the insertion and deletion editing controls to add or remove rows from the table and its data source. Aggregates `iOSMobileTableDataSource</api/ios/iosmobiletabledatasource>`.

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                                                       | Parameters                                                                                                                                                                                                                 | Returns                                                               | Shared |
|----------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|--------|
| `AllowRowEditing<iosmobiletabledatasourceediting.allowrowediting>`         | table As `iOSMobileTable</api/ios/iosmobiletable>`, section As `Integer</api/data_types/integer>`, row As `Integer</api/data_types/integer>`                                                                               | `Boolean</api/data_types/boolean>`                                    |        |
| `RowCount<iosmobiletabledatasourceediting.rowcount>`                       | table As `iOSMobileTable</api/ios/iosmobiletable>`, section As `Integer</api/data_types/integer>`                                                                                                                          | `Integer</api/data_types/integer>`                                    |        |
| `RowData<iosmobiletabledatasourceediting.rowdata>`                         | table As `iOSMobileTable</api/ios/iosmobiletable>`, section As `Integer</api/data_types/integer>`, row As `Integer</api/data_types/integer>`                                                                               | `MobileTableCellData</api/user_interface/mobile/mobiletablecelldata>` |        |
| `RowEditingCompleted<iosmobiletabledatasourceediting.roweditingcompleted>` | table As `iOSMobileTable</api/ios/iosmobiletable>`, section As `Integer</api/data_types/integer>`, row As `Integer</api/data_types/integer>`, action As `iOSMobileTable.RowEditingStyles<iosmobiletable.roweditingstyles>` |                                                                       |        |
| `SectionCount<iosmobiletabledatasourceediting.sectioncount>`               | table As `iOSMobileTable</api/ios/iosmobiletable>`                                                                                                                                                                         | `Integer</api/data_types/integer>`                                    |        |
| `SectionTitle<iosmobiletabledatasourceediting.sectiontitle>`               | table As `iOSMobileTable</api/ios/iosmobiletable>`, section As `Integer</api/data_types/integer>`                                                                                                                          | `String</api/data_types/string>`                                      |        |

## Method descriptions

<div id="iosmobiletabledatasourceediting.allowrowediting">

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

</div>

<div class="rst-class">

forsearch

</div>

iOSMobileTableDataSourceEditing.AllowRowEditing

**AllowRowEditing**(table As `iOSMobileTable</api/ios/iosmobiletable>`, section As `Integer</api/data_types/integer>`, row As `Integer</api/data_types/integer>`) As `Boolean</api/data_types/boolean>`

> Asks the data source if the specified *row* can be edited. Most data sources that implement this interface will unconditionally return `True</api/language/true>`.
>
> The specific type of edit that is allowed (None, Insert or Delete) is specified in the `iOSMobileTable.RowEditingStyles<iosmobiletable.roweditingstyles>` event.
>
> To allow row actions to work you must return `True</api/language/true>` from this method.
>
> In most cases, you will return `True</api/language/true>` for this method to allow the row to be edited:
>
> ``` xojo
> Return True
> ```

<div id="iosmobiletabledatasourceediting.rowcount">

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

</div>

<div class="rst-class">

forsearch

</div>

iOSMobileTableDataSourceEditing.RowCount

**RowCount**(table As `iOSMobileTable</api/ios/iosmobiletable>`, section As `Integer</api/data_types/integer>`) As `Integer</api/data_types/integer>`

> Return the number of rows for the *section*.
>
> Your class should return the number of rows in your data source for this *section*. For example, if you are showing a list of names in sections for the first letter of the last name, then this method would return the number of names in the specified section.

<div id="iosmobiletabledatasourceediting.rowdata">

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

</div>

<div class="rst-class">

forsearch

</div>

iOSMobileTableDataSourceEditing.RowData

**RowData**(table As `iOSMobileTable</api/ios/iosmobiletable>`, section As `Integer</api/data_types/integer>`, row As `Integer</api/data_types/integer>`) As `MobileTableCellData</api/user_interface/mobile/mobiletablecelldata>`

> The actual cell data for the *section* and *row*.
>
> You will need to create an `MobileTableCellData</api/user_interface/mobile/mobiletablecelldata>` instance and populate it with the values from your data source to return it from this method.

<div id="iosmobiletabledatasourceediting.roweditingcompleted">

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

</div>

<div class="rst-class">

forsearch

</div>

iOSMobileTableDataSourceEditing.RowEditingCompleted

**RowEditingCompleted**(table As `iOSMobileTable</api/ios/iosmobiletable>`, section As `Integer</api/data_types/integer>`, row As `Integer</api/data_types/integer>`, action As `iOSMobileTable.RowEditingStyles<iosmobiletable.roweditingstyles>`)

> Tells the data source that the user wants a row inserted or removed. The data source should update its internal state and inform the table of its changes. Data sources must not alter the table's editing state from within this method.
>
> The specific type of edit that is allowed (None, Insert or Delete) is specified in the `iOSMobileTable.ApplyRowEditingStyle<iosmobiletable.applyroweditingstyle>` event.
>
> If the user deleted a row, then remove it from the mSections Dictionary property used by the data source and remove it from the table:
>
> ``` xojo
> If action = iOSMobileTable.RowEditingStyles.Delete Then
>   Var sectionRows() As Integer = mSections.Value(section) 
>   sectionRows.Remove(row)
>   table.RemoveRow(section, row)
> End If
> ```

<div id="iosmobiletabledatasourceediting.sectioncount">

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

</div>

<div class="rst-class">

forsearch

</div>

iOSMobileTableDataSourceEditing.SectionCount

**SectionCount**(table As `iOSMobileTable</api/ios/iosmobiletable>`) As `Integer</api/data_types/integer>`

> Return the number of sections.
>
> You should return the total number of sections in your data source. For example, if you are displaying names with sections for each letter of the alphabet, then you might return 26 here.
>
> If you are not using sections, you can return 1 since there always needs to be at least one section.

<div id="iosmobiletabledatasourceediting.sectiontitle">

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

</div>

<div class="rst-class">

forsearch

</div>

iOSMobileTableDataSourceEditing.SectionTitle

**SectionTitle**(table As `iOSMobileTable</api/ios/iosmobiletable>`, section As `Integer</api/data_types/integer>`) As `String</api/data_types/string>`

> Return the title for the section.
>
> If you are not using sections, you can return empty text ("") here.
>
> When using sections, return the name for the specified section. For example, if you are displaying names with sections for each letter of the alphabet, you might return "A" when section of 0 is passed in as a parameter.

## Notes

Any data source that supports deletion and insertion of rows or that uses row actions must implement this interface.

When the iOSMobileTable is made editable (by setting iOSMobileTable.EditingEnabled = True):

- The data source's AllowRowEditing method is called for the visible rows and the editable rows get reordering controls.
- The user taps on a row's delete or insert button.
- The data source's RowEditingCompleted method is called so the data source can update its internal state.

## Compatibility

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

<div class="seealso">

`iOSMobileTable</api/ios/iosmobiletable>` control; `iOSMobileTableDataSource</api/ios/iosmobiletabledatasource>`, `iOSMobileTableDataSourceReordering</api/ios/iosmobiletabledatasourcereordering>`, `iOSMobileTableDataSourceIndex</api/ios/iosmobiletabledatasourceindex>` interfaces

</div>
