To do what you want, I work with the tableOfRowsInSection tableview method using bool variabile
if section == 3 { if !hideTableSection! { return 1 } else { return 2 } }
Every time I need to hide a cell, I change the bool variable and then reload the table.
It can only manage the last lines of each section, but I did not find anything better ...
source share