Chapter 22. Multitasking in depth
This chapter covers
- Monitoring the location service in the background
- Building an audio-playing application
- Enabling background audio playing
- Handling remote-control events
In the previous chapter, you learned the multitasking basics in iOS 4 and how to finish a task in the background with blocks and Grand Central Dispatch. When the application needs to (or for better user experience) continue running in the background, remember that these multitasking features are available on iOS 4:
- Audio—The application can continue running and play audio to the user while in the background. The user can use the multitasking UI or the lock screen UI to remotely control the audio play, pause, fast-forward, and so on.
- Location—The application can receive location updates to support location-related tasks or navigation in the background, such as the significant location change service and turn-by-turn directions.
- VoIP—Allows the application to receive voice calls through the internet even though other applications are in the foreground.
These multitasking features are useful and can boost your application to a brand-new level. In this last chapter of the book, first we’ll continue the background location-monitoring service from the previous chapter by building a location-tracking application. Next, we’ll focus on background audio playing and cover some additional advanced topics, such as handling interruptions and remote-control events.