Interface

# iOSMobileTableDataSourceReordering

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

## Description

The class interface that any data source supporting row reordering must implement.

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                                            | Parameters                                                                                                                                                                                                                                                 | Returns                                                               | Shared |
|-----------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|--------|
| `AllowRowMove<iosmobiletabledatasourcereordering.allowrowmove>` | 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<iosmobiletabledatasourcereordering.rowcount>`         | table As `iOSMobileTable</api/ios/iosmobiletable>`, section As `Integer</api/data_types/integer>`                                                                                                                                                          | `Integer</api/data_types/integer>`                                    |        |
| `RowData<iosmobiletabledatasourcereordering.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>` |        |
| `RowMoved<iosmobiletabledatasourcereordering.rowmoved>`         | table As `iOSMobileTable</api/ios/iosmobiletable>`, sourceSection As `Integer</api/data_types/integer>`, sourceRow As `Integer</api/data_types/integer>`, destSection As `Integer</api/data_types/integer>`, destRow As `Integer</api/data_types/integer>` |                                                                       |        |
| `SectionCount<iosmobiletabledatasourcereordering.sectioncount>` | table As `iOSMobileTable</api/ios/iosmobiletable>`                                                                                                                                                                                                         | `Integer</api/data_types/integer>`                                    |        |
| `SectionTitle<iosmobiletabledatasourcereordering.sectiontitle>` | table As `iOSMobileTable</api/ios/iosmobiletable>`, section As `Integer</api/data_types/integer>`                                                                                                                                                          | `String</api/data_types/string>`                                      |        |

## Method descriptions

<div id="iosmobiletabledatasourcereordering.allowrowmove">

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

</div>

<div class="rst-class">

forsearch

</div>

iOSMobileTableDataSourceReordering.AllowRowMove

**AllowRowMove**(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 moved. Most data sources will unconditionally return `True</api/language/true>`.
>
> ``` xojo
> Return True
> ```

<div id="iosmobiletabledatasourcereordering.rowcount">

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

</div>

<div class="rst-class">

forsearch

</div>

iOSMobileTableDataSourceReordering.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="iosmobiletabledatasourcereordering.rowdata">

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

</div>

<div class="rst-class">

forsearch

</div>

iOSMobileTableDataSourceReordering.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="iosmobiletabledatasourcereordering.rowmoved">

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

</div>

<div class="rst-class">

forsearch

</div>

iOSMobileTableDataSourceReordering.RowMoved

**RowMoved**(table As `iOSMobileTable</api/ios/iosmobiletable>`, sourceSection As `Integer</api/data_types/integer>`, sourceRow As `Integer</api/data_types/integer>`, destSection As `Integer</api/data_types/integer>`, destRow As `Integer</api/data_types/integer>`)

> Informs the data source that a row has been moved and that it needs to update its internal state to match this new order.
>
> ``` xojo
> ' Remove row from its original location
> Var origValue As String = Data(sourceRow)
> Data.RemoveRowAt(sourceRow)
>
> ' Add it to its new location
> Data.AddRowAt(destRow, origValue)
> ```

<div id="iosmobiletabledatasourcereordering.sectioncount">

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

</div>

<div class="rst-class">

forsearch

</div>

iOSMobileTableDataSourceReordering.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="iosmobiletabledatasourcereordering.sectiontitle">

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

</div>

<div class="rst-class">

forsearch

</div>

iOSMobileTableDataSourceReordering.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 reordering of rows must implement this interface.

When the table is made editable:

- The data source's `AllowRowMove<iosmobiletabledatasourcereordering.allowrowmove>` method is called for the visible rows and the movable rows get reordering controls.
- The user drags the row around the table, which can lead to more `AllowRowMove<iosmobiletabledatasourcereordering.allowrowmove>` invocations. While the user is moving the row, the table's visual state is updated to show where the row will go but the data source is not modified.
- The reorder finishes and the data source's `RowMoved<iosmobiletabledatasourcereordering.rowmoved>` 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>`, `iOSMobileTableDataSourceEditing</api/ios/iosmobiletabledatasourceediting>`, `iOSMobileTableDataSourceIndex</api/ios/iosmobiletabledatasourceindex>` interfaces

</div>
