Instance Property

representativeItem

A media item whose properties are representative of the other media items in a collection.

Declaration

var representativeItem: MPMediaItem? { get }

Discussion

The media items in a collection typically share common property values, owing to how the collection was built. For example, if you build a collection based on a predicate that uses the MPMediaItemPropertyArtist property, all items in the collection share the same artist name. You can use the representativeItem property to efficiently obtain values for such common properties—often more efficiently than fetching an item from the items array.

See Also

Using a Media Item Collection

var items: [MPMediaItem]

The media items in a media item collection.

var count: Int

The number of media items in a collection.

var mediaTypes: MPMediaType

The types of the media items in a collection.