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 ...

Get iOS Components and Frameworks: Understanding the Advanced Features of the iOS SDK 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.