A view that uses a spinning-wheel or slot-machine metaphor to show one or more sets of values.
- iOS 2.0+
The user interface provided by a picker view consists of components and rows. A component is a wheel, which has a series of items (rows) at indexed locations on the wheel. Each component also has an indexed location (left to right) in a picker view. Each row on a component has content, which is either a string or a view object such as a label (
UILabel) or an image (
UIImage). Users select values by rotating the wheels so that the desired row of values aligns with a selection indicator.
Note that the
UIDate class uses a custom subclass of
UIPicker to display dates and times. To see an example, tap the add (“+”) button in the Alarm pane of the Clock app.