---
title: "pickerView(_:didSelectRow:inComponent:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uipickerviewdelegate/pickerview(_:didselectrow:incomponent:)"
---

# pickerView(_:didSelectRow:inComponent:)

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

## Declaration

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

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.
