Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

11. Creating and Managing Table Views > Recipe: Using a View-based Picker

Recipe: Using a View-based Picker

Picker views work just as well with views as they do with titles. Figure 11-15 shows a picker view that displays card suits. These images are returned by the pickerView:viewForRow:forComponent:reusingView: data source method. You can use any kind of view you like, including labels, sliders, buttons, and so forth.

Image

Figure 11-15. This UIPickerView presents a series of card suit images, allowing users to pick a combination of three items.

Picker views use a basic view-reuse scheme, caching the views supplied to it for possible reuse. When the final parameter for this callback method is not nil, you can reuse that view by updating its settings or contents. Check for the view and allocate a new one only if one has not been supplied.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint