Current location - Health Preservation Learning Network - Healthy weight loss - Ios ~ ui tableview editing (cell insertion, deletion, movement)
Ios ~ ui tableview editing (cell insertion, deletion, movement)
Class: UITableView

Delegate: UITableViewDataSource, UITableViewDelegate

API involved: (For official detailed comments on API, see the end of this chapter)

Ideas:

1. Put TableView into editing state.

2. Specify which cell can be edited?

3. Specify the editing status of the cell (delete or insert)

4. Select the operation after deleting (or inserting) status (updating data source, deleting or inserting cells).

1. Put TableView in editing state (UIViewControll.m).

3. Specify the editing status of the cell (delete or insert) (UITableViewDelegate protocol method).

4. Select the operation after deleting (or inserting) status (updating data source, deleting or inserting cells) (UITableViewDataSource protocol method).

Class: UITableView

Deletage: UITableViewDataSource,UITableViewDelegate

API involved: (For official detailed comments on API, see the end of this chapter)

Ideas:

1. Makes TableView enter or exit the editing state.

2. Specify which cell of tableView can be moved.

3. Operation after moving the cell: Update the data source.

1. Makes TableView enter or exit the editing state.

2. Specify which cell of tableView can be moved (UITableViewDataSource protocol method).

3. Operation after moving the cell: Update the data source.