iOS Multitasking: Background Tasks


This Cyber Monday Envato Tuts+ courses will be reduced to just $3. Don't miss out.

This post is part of a series called iOS Multitasking.
iOS Multitasking: Background Audio
iOS Multitasking: Background Location

This is the third part in the iOS Multitasking Series. Compared to Local Notifications, Background Audio, Background Location, and VOIP (Not covered in this series), Background Tasks and Fast App Switching are the easiest to implement. For this tutorial, you will need to understand blocks.

Step 1: Creating the Project

For the simplicity of this tutorial, create a window based application so we do not have to deal with View Controllers and extras (same implementation is used no matter what template you use). Name it Background Task and uncheck "Use Core Data" and "Include Unit Tests".


Then open up the Background_TasksAppDelegate.m.

Step 2: Implementing the code

Now scroll down to the applicationDidEnterBackground: method and add the following code:

Wrap Up

As you can see, Background Tasks are extremely short and easy to implement. If you have any need for help or just want to post a suggesion, then comment below!