<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIPickerViewDataSource/pickerView(_:numberOfRowsInComponent:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UIPickerViewDataSource(im)pickerView:numberOfRowsInComponent:"
  },
  "title" : "pickerView(_:numberOfRowsInComponent:)"
}
-->

# pickerView(_:numberOfRowsInComponent:)

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

```
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

The number of rows for the component.

## Discussion

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)