Instance Property

indexPathsForVisibleItems

An array of the visible items in the collection view.

Declaration

@property(nonatomic, readonly) NSArray<NSIndexPath *> *indexPathsForVisibleItems;

Discussion

The value of this property is an unsorted array of NSIndexPath objects, each of which corresponds to a visible cell in the collection view. This array does not include any supplementary views that are currently visible. If there are no visible items, the value of this property is an empty array.

See Also

Locating Items and Views in the Collection View

- indexPathForItemAtPoint:

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

- indexPathForCell:

Returns the index path of the specified cell.

- cellForItemAtIndexPath:

Returns the visible cell object at the specified index path.

- indexPathsForVisibleSupplementaryElementsOfKind:

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

- supplementaryViewForElementKind:atIndexPath:

Returns the supplementary view at the specified index path.

- visibleSupplementaryViewsOfKind:

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