CellParentViewProtocol

public protocol CellParentViewProtocol

This protocol unifies UICollectionView and UITableView by providing a common dequeue method for cells. It describes a view that is the “parent” view for a cell. For UICollectionViewCell, this would be UICollectionView. For UITableViewCell, this would be UITableView.

Associated types

  • The type of cell for this parent view.

    Declaration

    Swift

    associatedtype CellType : UIView

Methods

  • Returns a reusable cell located by its identifier.

    Declaration

    Swift

    func dequeueReusableCellFor(identifier: String, indexPath: IndexPath) -> CellType

    Parameters

    identifier

    The reuse identifier for the specified cell.

    indexPath

    The index path specifying the location of the cell.

    Return Value

    A valid CellType reusable cell.

  • Returns a reusable supplementary view located by its identifier and kind.

    Declaration

    Swift

    func dequeueReusableSupplementaryViewFor(kind: String, identifier: String, indexPath: IndexPath) -> CellType?

    Parameters

    kind

    The kind of supplementary view to retrieve.

    identifier

    The reuse identifier for the specified view.

    indexPath

    The index path specifying the location of the supplementary view in the collection view.

    Return Value

    A valid CellType reusable view.