Switch to a new song/audio in background for iOS

If you have a music app, you might be using a code like this to play songs in your iOS app: - (void)next { // Find new index NSUInteger newIndex; // Create a new audio player for this index NSError *error = nil; AVAudioPlayer *newAudioPlayer =[[AVAudioPlayer alloc] initWithContentsOfURL:[(MDAudioFile *)[soundFiles objectAtIndex:selectedIndex] filePath]…