I don't think this is what I need, but I'm also fairly confused about what is going on with music these days so let me give some more information.
Several years ago I built a DJ app for a customer. This app provides the ability to do things such as mix songs together, play songs at different speeds (even backwards), change the tempo without changing the pitch, etc. In order to do this, I used AVAudioEngine. In order to get data for the audio graph, I used AVAsset to obtain unprotected music from the iTunes library. At the time (pre-Apple Music) it worked with most songs purchased the via iTunes Store and anything the user may have imported into iTunes on their own.
Nowadays, most people are switching to Apple Music. I don't know if or how an app like this would be able to still work. If a user subscribes to Apple Music, would my app be able to obtain and use any available song as an AVAsset? I would think this is not possible purely for the reason that it could lead to apps making unauthorized copies of music, but I don't really understand it for sure.
Assuming I can't use Apple Music and I'm limited to iTunes, what I want to do is be able to have the user search for songs within my app (using my UI) and then select songs and purchase them in a way that would make them available to my app. This would mean I'd like to limit the search and purchase to songs that are not covered by DRM, if such a thing even still exists. It's OK if my app has to open some other app to actually make the purchase, but if I could control the entire process, that would be best.
If none of this is really possible anymore, that's OK, I just need to figure it out and let my customer know, before I waste a lot of his money trying to implement something that can't be done.