iOS Platform & SwiftUI (50 Qs)•Part 3: Instruments Profiling, App Architecture & Production Hardening (25 - 35)
Background Execution Modes: `BGTaskScheduler`, Audio, and Location updates.
senior LevelPerformanceSystem Design
In Simple Words: iOS strictly restricts background execution to preserve user battery:
BGAppRefreshTask: Short execution window (up to 30 seconds) scheduled by the OS when the user is likely to open the app.BGProcessingTask: Long-running maintenance tasks (database cleanup, ML model training) executed only when the device is idle, connected to power, and connected to Wi-Fi.- Special Background Modes: Audio streaming, VoIP, Bluetooth peripheral communication, and continuous navigation turn-by-turn GPS.