---
title: "collectionView(_:cellForItemAt:)"
framework: CareKit
role: symbol
role_heading: Instance Method
platforms: [iOS 13.0+, Mac Catalyst 13.0+, watchOS 7.0+]
path: "carekit/ockgridtaskviewcontroller/collectionview(_:cellforitemat:)"
---

# collectionView(_:cellForItemAt:)

Returns the visible cell object at the specified index path.

## Declaration

```swift
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell
```

## Parameters

- `collectionView  `: The collection view the view controller displays.
- `indexPath  `: The index path that specifies the section and item number of the cell.

## See Also

### Configuring the Grid Collection View

- [collectionView(_:numberOfItemsInSection:)](carekit/ockgridtaskviewcontroller/collectionview(_:numberofitemsinsection:).md)
