Each province or municipality is the headView of a section, and the subordinate cities are the cells of this section. When you click the expand button, the number of cells in this section is controlled to be the number of subordinate cities. When you click the collapse button, the number of cells is set to 0 is fine. The data does not need to change, just set it in the proxy method of dataSource. The essence of each button click is actually the reloadSection of the tableview. . . .
One way to achieve this is by changing the data. The data structure needs to be organized.
This is the animation of the cell in the tableview
https://github.com/xmartlabs/XLForm
Each province or municipality is the headView of a section, and the subordinate cities are the cells of this section. When you click the expand button, the number of cells in this section is controlled to be the number of subordinate cities. When you click the collapse button, the number of cells is set to 0 is fine. The data does not need to change, just set it in the proxy method of dataSource. The essence of each button click is actually the reloadSection of the tableview. . . .