Instance Method

cellForItem(at:)

Returns the visible cell object at the specified index path.

Declaration

func cellForItem(at indexPath: IndexPath) -> UICollectionViewCell?

Parameters

indexPath

The index path that specifies the section and item number of the cell.

Return Value

The cell object at the corresponding index path or nil if the cell is not visible or indexPath is out of range.

See Also

Locating Items and Views in the Collection View

func indexPathForItem(at: CGPoint) -> IndexPath?

Returns the index path of the item at the specified point in the collection view.

var indexPathsForVisibleItems: [IndexPath]

An array of the visible items in the collection view.

func indexPath(for: UICollectionViewCell) -> IndexPath?

Returns the index path of the specified cell.

func indexPathsForVisibleSupplementaryElements(ofKind: String) -> [IndexPath]

Returns the index paths of all visible supplementary views of the specified type.

func visibleSupplementaryViews(ofKind: String) -> [UICollectionReusableView]

Returns an array of the visible supplementary views of the specified kind.