UITableView for iOS
UITableViewDelegate protocol Method
Returns the height of each row of cells.
-(CGFloat) tableView :( UITableView *) tableView heightForRowAtIndexPath :( NSIndexPath *) indexPath
Returns the height of the partition header.
-(CGFloat) tableView :( UITableView *) tableView heightForHeaderInSection :( NSInteger) section
Returns the height of the partition area.
-(CGFloat) tableView :( UITableView *) tableView heightForFooterInSection :( NSInteger) section
Return the custom View of the partition header (you can use the reuse mechanism)
-(UIView *) tableView :( UITableView *) tableView viewForHeaderInSection :( NSInteger) section
Return the custom View of the partition footer (you can use the reuse mechanism)
-(UIView *) tableView :( UITableView *) tableView viewForFooterInSection :( NSInteger) section
How to execute when the attachment button on the right of the cell is clicked
-(Void) tableView :( UITableView *) tableView accessoryButtonTappedForRowWithIndexPath :( NSIndexPath *) indexPath
Method To be executed when a cell is to be selected
-(NSIndexPath *) tableView :( UITableView *) tableView willSelectRowAtIndexPath :( NSIndexPath *) indexPath
How to run an unselected Cell
-(NSIndexPath *) tableView :( UITableView *) tableView willDeselectRowAtIndexPath :( NSIndexPath *) indexPath
Method used to select a cell
-(Void) tableView :( UITableView *) tableView didSelectRowAtIndexPath :( NSIndexPath *) indexPath
How to cancel execution when selecting a cell
-(Void) tableView :( UITableView *) tableView didDeselectRowAtIndexPath :( NSIndexPath *) indexPath
Set the editing style of each cell
-(UITableViewCellEditingStyle) tableView :( UITableView *) tableView editingStyleForRowAtIndexPath :( NSIndexPath *) indexPath
UITableViewCellEditingStyleNone,
UITableViewCellEditingStyleDelete,
UITableViewCellEditingStyleInsert
Set the button title
-(NSString *) tableView :( UITableView *) tableView titleForDeleteConfirmationButtonForRowAtIndexPath :( NSIndexPath *) indexPath
Set whether to scale down Cells
-(BOOL) tableView :( UITableView *) tableView shouldIndentWhileEditingRowAtIndexPath :( NSIndexPath *) indexPath
How to execute a cell when it is about to be edited
-(Void) tableView :( UITableView *) tableView willBeginEditingRowAtIndexPath :( NSIndexPath *) indexPath
How to run the command when the cell is edited
-(Void) tableView :( UITableView *) tableView didEndEditingRowAtIndexPath :( NSIndexPath *) indexPath
How to move a cell
-(NSIndexPath *) tableView :( UITableView *) tableView targetIndexPathForMoveFromRowAtIndexPath :( NSIndexPath *) sourceIndexPath toProposedIndexPath :( NSIndexPath *) proposedDestinationIndexPath
Whether to display copy and paste of menu
-(BOOL) tableView :( UITableView *) tableView shouldShowMenuForRowAtIndexPath :( NSIndexPath *) indexPath
UITableViewDataSource protocol Method
Required:
Number of rows per Partition
-(NSInteger) tableView :( UITableView *) tableView numberOfRowsInSection :( NSInteger) section
Content of each cell (the cell has a reuse mechanism and can be customized)
-(UITableViewCell *) tableView :( UITableView *) tableView cellForRowAtIndexPath :( NSIndexPath *) indexPath
Not required:
Number of partitions (1 by default)
-(NSInteger) numberOfSectionsInTableView :( UITableView *) tableView
Partition header title
-(NSString *) tableView :( UITableView *) tableView titleForHeaderInSection :( NSInteger) section
Partition footer title
-(NSString *) tableView :( UITableView *) tableView titleForFooterInSection :( NSInteger) section
Set whether cells can be edited.
-(BOOL) tableView :( UITableView *) tableView canEditRowAtIndexPath :( NSIndexPath *) indexPath
Sets whether cells can be moved.
-(BOOL) tableView :( UITableView *) tableView canMoveRowAtIndexPath :( NSIndexPath *) indexPath
Set the index array to the right of the table
-(NSArray *) sectionIndexTitlesForTableView :( UITableView *) tableView
Set the ing between table indexes and partitions
-(NSInteger) tableView :( UITableView *) tableView sectionForSectionIndexTitle :( NSString *) title atIndex :( NSInteger) index
Method executed when the cell editing status is submitted (that is, the Add. delete button)
-(Void) tableView :( UITableView *) tableView commitEditingStyle :( UITableViewCellEditingStyle) editingStyle forRowAtIndexPath :( NSIndexPath *) indexPath
Method executed when the cell is moved (from the initial position to the target position)
-(Void) tableView :( UITableView *) tableView moveRowAtIndexPath :( NSIndexPath *) sourceIndexPath toIndexPath :( NSIndexPath *) destinationIndexPath