Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide a static cell of Tableview in swift

I've an application that works with a static cells table view. In some cases in need to hide a few cells and when needed show them again. How can i do this ?

like image 246
Arian Avatar asked Jan 20 '15 17:01

Arian


Video Answer


1 Answers

To do what you wanna do I work with numberOfRowsInSection tableview's method using a bool variabile

if section == 3 {
    if !hideTableSection! { return 1 } else { return 2 }
}

Every time I need to hide some cell I change the bool variable then I reload my table.

It can manage only the latest rows of every section but I didn't find nothing better...

like image 85
Matte.Car Avatar answered Oct 23 '22 15:10

Matte.Car