---
title: "pickerView(_:numberOfRowsInComponent:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uipickerviewdatasource/pickerview(_:numberofrowsincomponent:)"
---

# pickerView(_:numberOfRowsInComponent:)

Asks the data source for the number of rows for a specified component.

## Declaration

```swift
func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int
```

## Parameters

- `pickerView`: The picker view requesting the data.
- `component`: A zero-indexed number identifying a component of pickerView. Components are numbered left-to-right.

## Return Value

Return Value The number of rows for the component.

## See Also

### Providing counts for the picker view

- [numberOfComponents(in:)](uikit/uipickerviewdatasource/numberofcomponents(in:).md)
