0

I struck in tableview. I need tableview of collapse and Expand looks like Below,

Table Section Collapse[![Table Section Expand]2

I need to add 2 buttons for last row of every section. Could you guide me how to design the below design in ios swift?

FelixSFD
  • 6,052
  • 10
  • 43
  • 117
suneel
  • 57
  • 8

3 Answers3

1

Add your buttons in custom view and feed it in UITableViewDataSource method below:

func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView?

ruslan.musagitov
  • 2,084
  • 2
  • 13
  • 14
0

Best way is take Two Button in one cell, and return that cell when indexPath.row = lastRow And add tap gesture on header view for collapse view

anshul king
  • 558
  • 4
  • 17
0

You can create a cell with two buttons. Next you should add it to your data source and configure it properly. Then add a delegate to your custom UITableViewCell and handle taps.

mikezs
  • 410
  • 1
  • 8
  • 16