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

# selectedRow(inComponent:)

Returns the index of the selected row in a given component.

```
func selectedRow(inComponent component: Int) -> Int
```

## Parameters

`component`

A zero-indexed number identifying a component of the picker view.

## Return Value

A zero-indexed number identifying the selected row, or `-1` if no row is selected.

---

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)