Display nested views using a configurable and highly customizable layout.
A collection view manages an ordered set of content, such as the grid of photos in the Photos app, and presents it visually.
Collection views are a collaboration between many different objects, including:
Cells. A cell provides the visual representation for each piece of your content.
Layouts. A layout defines the visual arrangement of the content in the collection view.
Your data source object. This object adopts the
UICollectionprotocol and provides the data for the collection view.
View Data Source
Your delegate object. This object adopts the
UICollectionprotocol and manages user interactions with the collection view's contents, like selection and highlighting.
Collection view controller. You typically use a
UICollectionobject to manage a collection view. You can use other view controllers too, but a collection view controller is required for some collection-related features to work.