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

# selectedRow(inComponent:)

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

## Declaration

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

## Parameters

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

## Return Value

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

## See Also

### Selecting rows in the view picker

- [selectRow(_:inComponent:animated:)](uikit/uipickerview/selectrow(_:incomponent:animated:).md)
