UICollectionView
extension UICollectionView
-
Dequeue cell for the UICollectionView.
Declaration
Swift
func dequeueReusableCell<Cell>(cellType: Cell.Type, for indexPath: IndexPath) -> Cell where Cell : UICollectionViewCell
Parameters
cellType
Concreate cell type.
indexPath
IndexPath of the cell.
-
Dequeue reusable view for the UICollectionView.
Declaration
Swift
func dequeueReusableSupplementaryView<ReusableView>(reusableViewType: ReusableView.Type, kind: String, for indexPath: IndexPath) -> ReusableView where ReusableView : UICollectionReusableView
Parameters
reusableViewType
Concreate reusable view type.
kind
The kind of reusable view to dequeue.
indexPath
IndexPath of the cell.
-
Registers cell’s nibs for the UICollectionView, nib file name must be the same as cell type.
Declaration
Swift
func register<Cell>(cellTypes: [Cell.Type], bunde: Bundle? = nil) where Cell : UICollectionViewCell
Parameters
cellTypes
Concreate cell types.
bundle
Bundle of nib, by default nil.
-
Registers reusable view’s nibs for the UICollectionView, nib file name must be the same as reusable view type.
Declaration
Swift
func register<ReusableView>(reusableViews: [ReusableView.Type], kind: String, bunde: Bundle? = nil) where ReusableView : UICollectionReusableView
Parameters
reusableViews
Concreate reusable view types.
kind
The kind of reusable view to create.
bundle
Bundle of nib, by default nil.