How to remove white spacing after hiding a cell in tableview

Viewed 235

I have a tableview that opens up a section every time I tap on one of the fields, to hide that section I tried attaching the cell in the class and doing:

passwordCreationCell.isHidden = true

the problem with that that every time I do it, I get a white empty cell,

enter image description here

how do I remove the white spacing? or how do I remove the cell from display \ add it again?

1 Answers

This case can be solved by two different ways

Either Remove hidden cells indexpaths from tableview or if you want the cell to be there on the tableview return 0 in heightForRowAtIndexpath

Related