Sample iOS 15 code (Swift) for playing audio in the background on an iOS app. Demonstrates MPMedia music queries, playing songs, and remote control events received in the control center. For more details, read this blog post: http://www.sagorin.org/ios-playing-audio-in-background-audio/
NOTE: Run code on a device with downloaded songs.
For the Objective-C version of this code, see https://github.com/jsagorin/iOSBackgroundAudio