Package apple.uikit.protocol
Interface UITableViewDataSource
-
- All Known Implementing Classes:
CABTMIDICentralViewController,UITableViewController,UITableViewDiffableDataSource
public interface UITableViewDataSource_______________________________________________________________________________________________________________ this protocol represents the data model object. as such, it supplies no information about appearance (including the cells)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default longnumberOfSectionsInTableView(@NotNull UITableView tableView)Default is 1 if not implementeddefault @Nullable NSArray<java.lang.String>sectionIndexTitlesForTableView(@NotNull UITableView tableView)return list of section titles to display in section index view (e.g.default booleantableViewCanEditRowAtIndexPath(@NotNull UITableView tableView, @NotNull NSIndexPath indexPath)Individual rows can opt out of having the -editing property set for them.default booleantableViewCanMoveRowAtIndexPath(@NotNull UITableView tableView, @NotNull NSIndexPath indexPath)Allows the reorder accessory view to optionally be shown for a particular row.@NotNull UITableViewCelltableViewCellForRowAtIndexPath(@NotNull UITableView tableView, @NotNull NSIndexPath indexPath)Row display.default voidtableViewCommitEditingStyleForRowAtIndexPath(@NotNull UITableView tableView, long editingStyle, @NotNull NSIndexPath indexPath)After a row has the minus or plus button invoked (based on the UITableViewCellEditingStyle for the cell), the dataSource must commit the change Not called for edit actions using UITableViewRowAction - the action's handler will be invoked insteaddefault voidtableViewMoveRowAtIndexPathToIndexPath(@NotNull UITableView tableView, @NotNull NSIndexPath sourceIndexPath, @NotNull NSIndexPath destinationIndexPath)Data manipulation - reorder / moving supportlongtableViewNumberOfRowsInSection(@NotNull UITableView tableView, long section)default longtableViewSectionForSectionIndexTitleAtIndex(@NotNull UITableView tableView, @NotNull java.lang.String title, long index)tell table which section corresponds to section title/index (e.g.default @Nullable java.lang.StringtableViewTitleForFooterInSection(@NotNull UITableView tableView, long section)default @Nullable java.lang.StringtableViewTitleForHeaderInSection(@NotNull UITableView tableView, long section)fixed font style.
-
-
-
Method Detail
-
numberOfSectionsInTableView
default long numberOfSectionsInTableView(@NotNull @NotNull UITableView tableView)Default is 1 if not implemented
-
sectionIndexTitlesForTableView
@Nullable default @Nullable NSArray<java.lang.String> sectionIndexTitlesForTableView(@NotNull @NotNull UITableView tableView)
return list of section titles to display in section index view (e.g. "ABCD...Z#")
-
tableViewCanEditRowAtIndexPath
default boolean tableViewCanEditRowAtIndexPath(@NotNull @NotNull UITableView tableView, @NotNull @NotNull NSIndexPath indexPath)Individual rows can opt out of having the -editing property set for them. If not implemented, all rows are assumed to be editable.
-
tableViewCanMoveRowAtIndexPath
default boolean tableViewCanMoveRowAtIndexPath(@NotNull @NotNull UITableView tableView, @NotNull @NotNull NSIndexPath indexPath)Allows the reorder accessory view to optionally be shown for a particular row. By default, the reorder control will be shown only if the datasource implements -tableView:moveRowAtIndexPath:toIndexPath:
-
tableViewCellForRowAtIndexPath
@NotNull @NotNull UITableViewCell tableViewCellForRowAtIndexPath(@NotNull @NotNull UITableView tableView, @NotNull @NotNull NSIndexPath indexPath)
Row display. Implementers should *always* try to reuse cells by setting each cell's reuseIdentifier and querying for available reusable cells with dequeueReusableCellWithIdentifier: Cell gets various attributes set automatically based on table (separators) and data source (accessory views, editing controls)
-
tableViewCommitEditingStyleForRowAtIndexPath
default void tableViewCommitEditingStyleForRowAtIndexPath(@NotNull @NotNull UITableView tableView, long editingStyle, @NotNull @NotNull NSIndexPath indexPath)After a row has the minus or plus button invoked (based on the UITableViewCellEditingStyle for the cell), the dataSource must commit the change Not called for edit actions using UITableViewRowAction - the action's handler will be invoked instead
-
tableViewMoveRowAtIndexPathToIndexPath
default void tableViewMoveRowAtIndexPathToIndexPath(@NotNull @NotNull UITableView tableView, @NotNull @NotNull NSIndexPath sourceIndexPath, @NotNull @NotNull NSIndexPath destinationIndexPath)Data manipulation - reorder / moving support
-
tableViewNumberOfRowsInSection
long tableViewNumberOfRowsInSection(@NotNull @NotNull UITableView tableView, long section)
-
tableViewSectionForSectionIndexTitleAtIndex
default long tableViewSectionForSectionIndexTitleAtIndex(@NotNull @NotNull UITableView tableView, @NotNull @NotNull java.lang.String title, long index)tell table which section corresponds to section title/index (e.g. "B",1))
-
tableViewTitleForFooterInSection
@Nullable default @Nullable java.lang.String tableViewTitleForFooterInSection(@NotNull @NotNull UITableView tableView, long section)
-
tableViewTitleForHeaderInSection
@Nullable default @Nullable java.lang.String tableViewTitleForHeaderInSection(@NotNull @NotNull UITableView tableView, long section)fixed font style. use custom view (UILabel) if you want something different
-
-