Before you begin
This is an iOS class. To complete the coding exercises, you will need a Xamarin.iOS development environment with either a configured iOS Simulator or a device to run the exercise on. Please read the setup requirements if you need help installing the Xamarin development environment.
Overview
After this session you will be able to improve the user experience of your application by allowing an ongoing operation to continue, even if your app is no longer the active one.
Objectives
- Understand the iOS Backgrounding Model
- Work with Finite-Length Tasks
Lecture
IOS210 - Intro to Backgrounding: Running Finite-Length Tasks
Exercises
Exercise materials are available from GitHub. The code can be cloned through a desktop Git client or downloaded directly as a ZIP file.
-
Integrate a Finite-Length Task with the application lifecycleExercise
Apps often have to save state information when leaving the foreground. In this exercise you will learn how to request enough time from the operating system to complete such an operation. -
Code a cancellable Finite-Length TaskExercise
In this exercise you will wrap an ongoing operation into a Finite-Length Task and make the operation cancellable in case the app runs out of background time.