Contents

UIPickerView

A view that uses a spinning-wheel or slot-machine metaphor to show one or more sets of values.

Declaration

@MainActor class UIPickerView

Mentioned in

Overview

A picker view displays one or more wheels that the user manipulates to select items. Each wheel — known as a component — has a series of indexed rows representing the selectable items. Each row displays a string or view so that the user can identify the item on that row. Users select items by rotating the wheels to the desired values, which align with a selection indicator.

You provide the data to display in your picker view using a picker data source (an object that adopts the UIPickerViewDataSource protocol). Use your picker view delegate (an object that adopts the UIPickerViewDelegate protocol) to provide views for displaying your data and responding to user selections.

Topics

Providing the picker data

Customizing the picker behavior

Getting the dimensions of the picker view

Reloading the picker view

Selecting rows in the view picker

Returning the view for a row and component

Managing the appearance of the picker view

See Also

Content views