Exploring UITableView further
In this section, we'll touch on some extra little bits that will allow you to make the most out of UITableView
. We'll also cover in more detail some areas previously explored, such as the reuse identifier.
Further understanding reuse identifiers
Earlier in this chapter, you learned about cell-reuse in table views. We assigned a reuse identifier to a table view cell so that the table view would know which cell it should use to display contacts in. Cell-reuse is a concept that is applied to a table view so that it can reuse cells that it has already created.
This means that the only cells that are in memory are either on the screen or barely off the screen. The alternative would be to keep all cells in memory, which could potentially mean that hundreds of thousands of cells are held in memory at any given time.
For a visualization of what cell reuse looks like, have a look at the following diagram: