persistentIDProperty(forGroupingType:)
Obtains the persistent identifier key for a specified grouping type.
Declaration
class func persistentIDProperty(forGroupingType groupingType: MPMediaGrouping) -> StringParameters
- groupingType:
The grouping type that you want the persistent identifier key for.
Return Value
The identifier for the group type.
Discussion
Use this convenience method to obtain the key for a specific persistent identifier based on a grouping type. You can use that key, in turn, to obtain the value of a specific persistent ID of a media item, such as album title or artist name. Using this method simplifies such tasks as drilling down from an artist, to albums by that artist, to a specific album.
For example, the following statement returns the persistent identifier key for the album grouping type:
You could then obtain the specific persistent ID that you want by using the value(forProperty:) method. MPMediaGrouping describes grouping keys.