1.What
the UICollectionViewController class represents a view controller whose content consists of a collection view.
THE  uicollectionview class manages an ordered collection of data items and presents them using Customiz Able layouts.
2.Why
Collection views provide the same general function as table views except that a Collection view are able to support more th An just single-column layouts. Collection views support customizable layouts The can be used to implement multi-column grids, tiled layouts, circular LA Youts, and many more. You can even change the layout of a collection view dynamically if you want.
3.How
3.1uicollectionviewlayout (description of CollectionView layout information)
The job of a layout object is to determine the placement of cells, supplementary views, and decoration views inside the CO Llection view ' s bounds and to report that information to the collection view when asked. The collection view then applies the provided layout information to the corresponding views so this they can be presented Onscreen.
Collection Views has three types of visual elements that need to being laid out:
-
Cells are The main elements positioned by the layout. Each cell represents a single data item in the collection. A collection view can has a single group of cells or it can divide those cells into multiple sections. The layout object's main job is to arrange the cells in the collection view ' s content area.
-
supplementary views present data, but is different than cells. Unlike cells, supplementary views cannot is selected by the user. Instead, supplementary views to implement things like headers and footer views for a given sections or for the Entir E collection View. Supplementary views was optional and their use and placement was defined by the layout object.
-
decoration Views is visual adornments that cannot is selected and is not inherently tied to the data of the COL Lection view. Decoration views is another type of supplementary view. Like supplementary, they was optional and their use and placement was defined by the layout object.
Methods to Override (Required)//Refer to the documentation
Optimizing Layout Performance Using invalidation contexts//referencing the document
3.2 Uicollectionviewcell (the item that made up CollectionView)
A UICollectionViewCell Object presents, the content for a, single data item, when this item is within the collection view ' s visible bounds.
Similar UITableViewCell
In summary, UITableView can depict the visual, Uicollectionview can be depicted, and richer. As for the development choice, it is based on actual scenarios and requirements.
IOS Uicollectionviewcontoller Related