iOS Platform & SwiftUI (50 Qs)•Part 2: Combine, Persistence, Security & Networking (11 - 24)
How does Background Execution work on iOS (BackgroundTasks framework)?
mid LevelSecurity & Auth
In Simple Words: iOS suspends apps within seconds of entering the background:
BGTaskScheduler: Used for scheduling deferrable background maintenance:BGAppRefreshTask: Short ~30-second window to fetch latest news/feeds.BGProcessingTask: Long-running background jobs (database cleanup, ML model training); executed only when the device is idle, on Wi-Fi, and connected to power overnight.
- Apps must declare
UIBackgroundModesinInfo.plist.