UICollectionView
public extension UICollectionView
-
Registers a cell to be used by a UICollectionView.
Declaration
Swift
func register<T>(cell cellType: T.Type) where T : UICollectionViewCell, T : NibLoadableParameters
cellTypeA nibloadable collection view cell type to take the identifier and nib from.
-
Registers a header to be used by a UICollectionView.
Declaration
Swift
func register<T>(header headerType: T.Type) where T : UICollectionReusableView, T : NibLoadableParameters
headerTypeA nibloadable reusable view type to take the identifier and nib from.
-
Registers a footer to be used by a UICollectionView.
Declaration
Swift
func register<T>(footer footerType: T.Type) where T : UICollectionReusableView, T : NibLoadableParameters
footerTypeA nibloadable reusable view type to take the identifier and nib from.
-
Returns a reusable cell of the type specified to be used and adds it to the UICollectionView in the indexPath specified.
Declaration
Swift
func dequeue<T>(cell cellType: T.Type, for indexPath: IndexPath) -> T? where T : UICollectionViewCellParameters
cellTypeA collection cell to take the identifier from.
indexPathIndexPath where to add the cell to the collection view.
-
Returns a reusable header of the type specified to be used and adds it to the UICollectionView in the indexPath specified.
Declaration
Swift
func dequeue<T>(header headerType: T.Type, for indexPath: IndexPath) -> T? where T : UICollectionReusableViewParameters
headerTypeA collection reusable header view to take the identifier from.
-
Returns a reusable footer of the type specified to be used and adds it to the UICollectionView in the indexPath specified.
Declaration
Swift
func dequeue<T>(footer footerType: T.Type, for indexPath: IndexPath) -> T? where T : UICollectionReusableViewParameters
footerTypeAA collection reusable footer view to take the identifier from.
UICollectionView Extension Reference