returned from songs from the user library
How!? Unless you explain how, I'm afraid the song variable that you refer to means nothing to the rest of the world. If you access this URL ( https://itunes.apple.com/search?term=classical+music&entity=song ), in the meantime, with URLSession, it will return two objects: resultCount and results. And you can easily return a dataset in the form of a JSON object. The results returns an array of dictionaries including a property named 'releaseDate.' Additionally, provided that you got your dataset with MPMediaQuery.songs, I would search for the 'MPMediaItem' class. Other than that, you probably want to explain how you get your data.