Login required for access
In order to watch this lesson, you'll need to login to the website.
Handling Interruptions and Lock Screen Fixes
Podcasts
When you are building out an audio playback application, you have to be aware of the fact that your app can be interrupt at any give time. For example, you might receive a phone call while you are listening to an episode. In order to capture these events, we'll add an observer to NotificationCenter to monitor for interruptions. Next we handle how to update our UI whenever an interruption begins, and resume playback when an interruption ends.
### PlayerDetailsView.swift ```swift deinit { //Don't forget to remove yourself as an observer in deinit. //If you don't include this, your object will be forever retained. NotificationCenter.default .removeObserver(self, name: .AVAudioSessionInterruption, object: nil) } ```

Comments (3)
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
HELP & SUPPORT