I'm able to access the music that is downloaded on my iPhone THAT I PURCHASED before Apple Music existed. However, I can't seem to find the URLs of the songs that I've downloaded through Apple Music. Does anybody know anything about Apple Music when it comes to accessing the files?
Here is my code for accessing my music:
override func viewDidLoad() {
let query = MPMediaQuery.songsQuery()
for song in query.items! {
if let _ = song.valueForProperty(MPMediaItemPropertyAssetURL) as? NSURL {
songsArray.append(song)
songTitles.append(song.title!)
songArtists.append(song.artist!)
}
}
}