---
title: dataSource
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uicollectionview/datasource
---

# dataSource

The object that provides the data for the collection view.

## Declaration

```swift
weak var dataSource: (any UICollectionViewDataSource)? { get set }
```

## Discussion

Discussion The data source must adopt the UICollectionViewDataSource protocol. The collection view maintains a weak reference to the data source object.

## See Also

### Providing the collection view data

- [UICollectionViewDiffableDataSource](uikit/uicollectionviewdiffabledatasource-9tqpa.md)
- [UICollectionViewDataSource](uikit/uicollectionviewdatasource.md)
- [Building high-performance lists and collection views](uikit/building-high-performance-lists-and-collection-views.md)
