UICollectionView
extension UICollectionView
-
Register a cell view type that implements ReusableView protocol.
Declaration
Swift
public func register<T>(_: T.Type) where T : UICollectionViewCell, T : ReusableViewParameters
_the cell class to register (ignored)
-
Register a cell view type that implements the NibLoadableView protocol.
Declaration
Swift
public func register<T: UICollectionViewCell>(_: T.Type) where T: ReusableView, T: NibLoadableViewParameters
_the cell class to register (ignored)
-
Obtain a cell view to use to render cell content in a collection view.
Declaration
Swift
public func dequeueReusableCell<T: UICollectionViewCell>(for indexPath: IndexPath) -> T where T: ReusableViewParameters
indexPaththe location of the cell that is being rendered
Return Value
instance of a T class
-
Generic method to obtain the cell at a given index. Will return nil if index is invalid or not visible.
Declaration
Swift
public func cellForItem<T: UICollectionViewCell>(at indexPath: IndexPath) -> T? where T: ReusableViewParameters
indexPaththe index to use
Return Value
optional cell of the indicated type
View on GitHub
UICollectionView Extension Reference