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

# dataSource

The data source for the picker view.

## Declaration

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

## Discussion

Discussion The data source must adopt the UIPickerViewDataSource protocol and implement the required methods to return the number of components and the number of rows in each component.

## See Also

### Providing the picker data

- [UIPickerViewDataSource](uikit/uipickerviewdatasource.md)
