How to effectively distribute and defer work from the foreground to the background.

Shot by Charles Deluvio, in Unsplash

Previously, we had a good overview of how the Background Execution is handled after iOS 13. Now is time to get our hands on it. In this article I will share with you my own implementation and my findings.

I have set up an app to demonstrate how the background tasks works in practice. It follows Appleโ€™s Project Sample (you can find here), but it is a bit simpler. It is called Footprints.

It mainly schedules 2 tasks (one of each type) when the app goes intoโ€ฆ


How to effectively distribute and defer work from the foreground to the background.

Shot by Sergey Zolkin, in Unsplash

Last year Apple's Software Battery Life Team introduced in the WWDC the brand new BackgroundTasks Framework. It's a very lightweight โ€” yet powerful โ€” library, it holds only 7 new classes (2 being abstract). It mainly exposes APIs we can use to schedule tasks to run in the background.

Background Tasks isn't a new thing, though. It's been around since iOS 7, with a different โ€” and now deprecated โ€” API. โ€ฆ

Felipe Ricieri

Software Engineering, Concurrent Computing Enthusiast. Talk to me in ๐Ÿ‡ฌ๐Ÿ‡ง & ๐Ÿ‡ง๐Ÿ‡ท (๐Ÿ‡ฎ๐Ÿ‡น & ๐Ÿ‡ซ๐Ÿ‡ท beta).

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store