UITableView: hide cells animated?

I am trying to make some of my cells UITableViewinvisible. By clicking the button, they must switch the visibility. I tried a Hiddenclass property UITableViewCell, but it cannot be animated. Setting the cell Frameto a height of 0 will make the cell small, but not hidden, and it will not be animated.

Any ideas?

+3
source share
1 answer

What you should use is a method [UITableView deleteRowsAtIndexPaths:withRowAnimation:]. Be sure to configure the method tableView:numberOfRowsInSection:to reflect the number of rows deleted or your application will crash.

+6
source

Source: https://habr.com/ru/post/1793157/


All Articles