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

# pickerView(_:didSelectRow:inComponent:)

Called by the picker view when the user selects a row in a component.

```
optional func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int)
```

## Parameters

`pickerView`

An object representing the picker view requesting the data.

`row`

A zero-indexed number identifying a row of `component`. Rows are numbered top-to-bottom.

`component`

A zero-indexed number identifying a component of `pickerView`. Components are numbered left-to-right.

## Discussion

To determine what value the user selected, the delegate uses the `row` index to access the value at the corresponding position in the array used to construct the component.

---

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)