Contents

MPMediaItemCollection

A sorted set of media items from the media library.

Declaration

class MPMediaItemCollection

Overview

Typically, you use this class by requesting an array of collections from a media query by way of its collections property. MPMediaQuery describes media queries.

The grouping type for the media query determines the arrangement of the media items you obtain. You also use the media query collections property to obtain synced playlists, as described in MPMediaPlaylist.

A media item collection can have a wide range of metadata associated with it. You access this metadata using the value(forProperty:) method along with the property keys described in this document. You can also access metadata in a batch fashion using the enumerateValues(forProperties:using:) method. In some cases, this is more efficient. MPMediaEntity defines and describes both of these methods.

Topics

Creating a media item collection

Using a media item collection

See Also

Media items and playlists