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

# numberOfComponents(in:)

Asks the data source for the number of components in the picker view.

```
func numberOfComponents(in pickerView: UIPickerView) -> Int
```

## Parameters

`pickerView`

The picker view requesting the data.

## Return Value

The number of components (or “columns”) that the picker view should display.

---

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)