Changes

Jump to: navigation, search

An Overview of iOS 7 Collection View and Flow Layout

52 bytes added, 14:19, 28 March 2018
no edit summary
Before the introduction of Collection Views and Flow Layout, the closest iOS came to providing organized data presentation involved the use of the Table View. Whilst still a powerful user interface design option, the Table View was intended to fill a very specific need and, as such, has some limitations in terms of flexibility. Table View, for example, displays data in cells arranged in a single column layout. Collection views, on the other hand, provide a high degree of flexibility, allowing cells to be organized in just about any configuration imaginable, including grids, stacks, tiles and circular arrangements.
The goal of this chapter is to present an overview of the key elements that make up collection views prior to working through a step by step tutorial in the next chapter, entitled [[An iOS 7 Storyboard-based Collection View Tutorial|An iOS Storyboard-based Collection View Tutorial]].
== An Overview of Collection Views ==
* '''collectionView(_:layout:referenceSizeForFooterInSection:)''' - Required to return the size for the footer supplementary view for specified collection view section. Note that if a size is not specified, the view will not appear.
== Cell and View Reuse ==
As previously discussed, the code for a typical application using a collection view will not directly create instances of either the cell or supplementary view classes. The reasoning behind this becomes evident when performance and memory requirements are taken into consideration. Consider, for example, a collection view that is required to display 1000 photo images. It can be assumed with a reasonable degree of certainty that only a small percentage of cells will be visible to the user at any one time. If the application were permitted to create each of the 1000 cells in advance the device would very quickly run into memory limitations.

Navigation menu