I have a UITableView with cells having data from server response which means not everytime all the cells displays the data. So I need to remove those "empty" cells.I have already searched and could not find any possible solution. The solution from How to remove empty cells in UITableView? didn't work out. Actually it made my tableview disappear.
I need another solution other than the addition of a footer view. Is there any?
You should check your data which is coming from the server and only add not nil data to tableview data source.
After that reload your tableview.
This way your tableview won't have any empty cells. simple.
In case your problem is that number of cell being displayed doesn't fill up your view
you can try
tableview.tableFooterView = UIView()
You can use one of the two methods.
1. self.tableView.tableFooterView.frame = CGRectZero;
2. self.tableView.tableFooterView = [[UIView alloc]initWithFrame:CGRectZero];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With