---
title: "numberOfRows(inComponent:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uipickerview/numberofrows(incomponent:)"
---

# numberOfRows(inComponent:)

Returns the number of rows for a component.

## Declaration

```swift
func numberOfRows(inComponent component: Int) -> Int
```

## Parameters

- `component`: A zero-indexed number identifying a component.

## Return Value

Return Value The number of rows in the given component.

## Discussion

Discussion A picker view fetches the value of this property from the data source and and caches it. The default value is zero.

## See Also

### Getting the dimensions of the picker view

- [numberOfComponents](uikit/uipickerview/numberofcomponents.md)
- [rowSize(forComponent:)](uikit/uipickerview/rowsize(forcomponent:).md)
