Efficiency awaits: Background tasks in SwiftUI

RSS for tag

Discuss the WWDC22 Session Efficiency awaits: Background tasks in SwiftUI

Posts under wwdc2022-10142 tag

3 Posts
Sort by:
Post not yet marked as solved
4 Replies
770 Views
I know ios apps have the following lifecycle. active background suspended not running inactive My question is if my app can be killed in background state in the lifecycle above? Especially, I'm using beginBackgroundTask(expirationHandler:) to extend background time before suspended. Then my app is terminated with the following message without expirationHandler being called. Message from debugger: Terminated due to signal 9 Does this potentially happen? Actually I'm runnning a heavy task that requires CPU usage in background state, so is this a cause of this problem?
Posted Last updated
.
Post not yet marked as solved
1 Replies
1.4k Views
Need to run a task in the background that will take several minutes, so BGProcessingTaskRequest seems more appropriate than BGAppRefreshTaskRequest. I'm not sure however that the .backgroundTask modifier will run this since its two possible arguments are either .appRefresh or .UrlSession Thank you in advance, Javier
Posted Last updated
.