What are the best practices when dealing with UITableViews in order to improve the performance, speed up the development and maintenance when dealing with UITableViews?
Short answer is that this extra padding is probably due to the table view header (not the section header), and that UITableView doesn't like to be assigned a header with a height of 0.0.
For the listing details of each item, people use UITableView because it shows more info on each item. The UICollectionView class manages an ordered collection of data items and presents them using customizable layouts.
Cache can basically solve most performance problems. TableView needs to know the height of the Cell to layout the Cell. You need to know the height of all the Cells to know the height of the TableView itself. Therefore, every time you call reloadData, you need to calculate the height of all the Cells.
UITableView manages the basic appearance of the table, but your app provides the cells ( UITableViewCell objects) that display the actual content. The standard cell configurations display a simple combination of text and images, but you can define custom cells that display any content you want.
This isn't the first time this question has been asked on SO. Here's my previous answer on the matter:
[items objectAtIndex:indexPath.row]
in the -tableView:cellForRowAtIndexPath:
methodAlso watch the WWDC video on using instruments, they go over how to find where drawing code is killing performance. This year had some (some, not all) really great sessions.
Optimize last, so subclass UITableViewCell if you need custom cells - and if you someday want to improve rendering performance you might want to render the content using drawRect: instead.
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