How to design and code this in swift(IOS) AND Xcode.If we tap on down button it should display items and vice-versa like this:
Asked
Active
Viewed 112 times
-2
-
This question is too broad (and I voted to close it as such). You need to look at examples of [expanding and collapsing UITableViewCells](https://stackoverflow.com/questions/36917030/expand-and-collapse-tableview-cells). – Michael Dautermann Jul 11 '17 at 11:58
2 Answers
0
You need a Collapsable TableView. In order to achieve that, in your TableView you must keep track of which sections are collapsed (contracted) and which of them are expanded. For this you need to maintain a set of indices of sections that are expanded, or a boolean array where the value of each index indicates if the corresponding section is expanded or not. Check for the values at the specific index while assigning height to a certain row. Check this link for more help.

luckyShubhra
- 2,731
- 1
- 12
- 19