-2

I have UITableViewCell that consists button, label, collection view and view. At first it should return only button and label, but after clicking on button it should change its height to show view then when view is clicked it should show collection view with elements. Some ideas how to solve it?

enter image description here

Lal Krishna
  • 15,485
  • 6
  • 64
  • 84

1 Answers1

1
  1. Enter the views you want to show/hide on button click inside the stack-view and hide those views initially.

  2. Get the indexPath of the cell when the button is clicked. Reference:get indexPath of UITableViewCell on click of Button from Cell

  3. Set isHidden false for the views where the button was clicked.

  4. Reload cell at that indexPath to view result.

Bista
  • 7,869
  • 3
  • 27
  • 55