---
title: "numberOfComponents(in:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uipickerviewdatasource/numberofcomponents(in:)"
---

# numberOfComponents(in:)

Asks the data source for the number of components in the picker view.

## Declaration

```swift
func numberOfComponents(in pickerView: UIPickerView) -> Int
```

## Parameters

- `pickerView`: The picker view requesting the data.

## Return Value

Return Value The number of components (or “columns”) that the picker view should display.

## See Also

### Providing counts for the picker view

- [pickerView(_:numberOfRowsInComponent:)](uikit/uipickerviewdatasource/pickerview(_:numberofrowsincomponent:).md)
