IOS UICollectionViewContoller, iosviewcontroller
1. What
TheUICollectionViewController
Class represents a view controller whose content consistsA collection view.
TheUICollectionView
Class manages an ordered collection of data items and presents them using customizable layouts.
2. Why
Collection views provide the same general function as table views doesn't that a collection view is able to support more than just single-column layouts. collection views support customizable layouts that can be used to implement multi-column grids, tiled layouts, circular layouts, and more. you can even change the layout of a collection view dynamically if you want.
3. How
3.1 UICollectionViewLayout (describe the layout information of CollectionView)
The job of a layout object is to determine the placement of cells, supplementary views, and decoration views inside the collection 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 that they can be presented onscreen.
Collection views haveThreeTypes of visual elements that need to be laid out:
CellsAre the main elements positioned by the layout. each cell represents a single data item in the collection. A collection view can have 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 viewsPresent data but are different than cells. unlike cells, supplementary views cannot be selected by the user. instead, you use supplementary views to implement things like header and footer views for a given section or for the entire collection view. supplementary views are optional and their use and placement is defined by the layout object.
Decoration viewsAre visual adornments that cannot be selected and are not inherently tied to the data of the collection view. decoration views are another type of supplementary view. like supplementary views, they are optional and their use and placement is defined by the layout object.
Methods to Override (Required) // Refer to the workshop document.
Optimizing Layout Performance Using Invalidation Contexts // refer to the optimize document.
3.2 UICollectionViewCell (the item that makes up CollectionView)
AUICollectionViewCell
Object presents the content for a single data item when that item is within the collection view's visible bounds.
Similar to UITableViewCell
In summary, both the UITableView and UICollectionView can be depicted and richer. As for the Development selection, we should proceed according to the actual scenarios and requirements.