Data Source and Delegate Methods

Implement three key data source methods for your UIPickerView to make it function properly at a minimum level. These methods are as follows:

Image numberOfComponentsInPickerView:Return the number of columns, as an integer.

Image pickerView:numberOfRowsInComponent:Return the maximum number of rows per wheel, as an integer. The number of rows does not need to be identical. You can have one wheel with many rows and another with very few.

pickerView:titleForRow:forComponent or pickerView:viewForRow:forComponent: reusingView: ...

Get The Core iOS Developer’s Cookbook, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.