iOS Components and Frameworks: Understanding the Advanced Features of the iOS SDK
by Kyle Richter, Joe Keeley
Media Picker
The simplest way to allow a user to specify which song he wants to hear is to provide him access to an MPMediaPickerController, as shown in Figure 6.2. The MPMediaPickerController allows the user to browse his artists, songs, playlists, and albums to specify one or more songs that should be considered for playback. To use an MPMediaPickerController, the class first needs to specify that it handles the delegate MPMediaPickerControllerDelegate, which has two required methods. The first mediaPicker:didPickMediaItems: is called when the user has completed selecting the songs she would like to hear. Those songs are returned as an MPMediaItemCollection object, and the MPMusicPlayerController can directly take this object as a parameter ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access