Testing Background Transfers

To test, begin your download and tap the Home button on the device to suspend your app or use the Exit App button in the navigation bar. This button calls abort(), a function that immediately terminates the application. (Don’t ever use this function in a production application; it will be rejected in the app review process.)

Immediately relaunching the application after backgrounding or termination should bring up the app with the download still in progress. Following this same process without relaunching allows the transfer to complete in the background. When it is complete, the app is launched in the background, kicking off a local notification and an update of the UI in the task switcher.

Recipe 13-4 Background ...

Get The Core iOS Developer’s Cookbook, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.