1. Code
  2. iOS SDK

iOS Multitasking: Background Tasks

Read Time:1 minLanguages:
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!

Looking for something to help kick start your next project?
Envato Market has a range of items for sale to help get you started.