UIPickerViewDelegate
The interface for a picker view’s delegate.
Declaration
@MainActor protocol UIPickerViewDelegate : NSObjectProtocolOverview
The delegate of a UIPickerView object must adopt this protocol and implement at least some of its methods to provide the picker view with the data it needs to construct itself.
The delegate implements the required methods of this protocol to return height, width, row title, and the view content for the rows in each component. It must also provide the content for each component’s row, either as a string or a view. Typically the delegate implements other optional methods to respond to new selections or deselections of component rows.
See UIPickerView for a discussion of components, rows, row content, and row selection.
Topics
Setting the dimensions of the picker view
Setting the content of component rows
pickerView(_:titleForRow:forComponent:)pickerView(_:attributedTitleForRow:forComponent:)pickerView(_:viewForRow:forComponent:reusing:)