Chapter 21. Introducing multitasking

 

This chapter covers

  • Overview of multitasking on iOS 4
  • Fast app switching
  • Finishing a task in the background
  • Monitoring location change in the background

iOS 4 is muscled up with tons of exciting new features. We’ve covered the Game Kit framework, local notifications, the Event Kit framework, GCD, and iAd in previous chapters. In this chapter, it’s time to introduce multitasking! Multitasking is a feature that has been requested on iOS since its first release. But there’s limited screen size and battery life on the iPhone or iPad, so generally only one application is visible and active at a time. In iOS 4 and later, with multitasking introduced, applications can continue running in the background.

What’s multitasking? It’s one of the important and exciting API features in iOS 4. When the user quits an application, instead of terminating, the application will enter the background state; you can use this feature to support fast app switching and running tasks in the background.

21.1. Overview of multitasking

21.2. Background state

21.3. Using fast app switching

21.4. Task completion in the background

21.5. Monitoring location changes in the background

21.6. Summary