Instance Method

supplementaryView(forElementKind:at:)

Returns the supplementary view at the specified index path.

Declaration

func supplementaryView(forElementKind elementKind: String, at indexPath: IndexPath) -> UICollectionReusableView?

Parameters

elementKind

The kind of supplementary view to locate. This value is defined by the layout object. This parameter must not be nil.

indexPath

The index path of the supplementary view. This parameter must not be nil.

Return Value

The specified supplementary view or nil if the view could not be found.

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 cellForItem(at: IndexPath) -> UICollectionViewCell?

Returns the visible cell object at the specified index path.

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.