iOS CapabilitiesLesson 62Free preview
Background Work
This lesson is part of Swift · All levels
Summary
This lesson discusses how to manage Background Tasks on iOS using the BackgroundTasks (BGTaskScheduler) framework. The iOS operating system is very strictly limiting the process in the background to save battery. Developers will learn the types of official Background Modes such as audio playback, location tracking, and background app refresh.
Key points
- IOS restricts background execution strictly to maintain battery efficiency of the device
- Background Mode must be activated through the 'Signing & Capabilities' tab in Xcode
- BGAppRefreshTask is used for short-term updates (such as synchronizing feeds)
- BGProcessingTask is used for long-term heavy processing tasks (such as training local ML models while charging)
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.