---
title: numberOfComponents
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uipickerview/numberofcomponents
---

# numberOfComponents

The number of components for the picker view.

## Declaration

```swift
var numberOfComponents: Int { get }
```

## Discussion

Discussion A UIPickerView object fetches the value of this property from the data source and caches it. The default value is 0.

## See Also

### Getting the dimensions of the picker view

- [numberOfRows(inComponent:)](uikit/uipickerview/numberofrows(incomponent:).md)
- [rowSize(forComponent:)](uikit/uipickerview/rowsize(forcomponent:).md)
