I am working on music app and it has feature of switching between playing/not playing music when app minimized. How can I do it?
I use that code to enable playing in backgound, but how can I disable it?
do {
try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback)
try AVAudioSession.sharedInstance().setActive(true)
} catch let error as NSError {
print(error.localizedDescription)
}