Indeed. I guess I should be able to recognise our own documentation code )-: Anyway, with that context, I can answer your specific questions: is the function RefreshAppContentsOperation() where to implement code that needs to be run in the background? Yes and no. In this example RefreshAppContentsOperation is meant to be an Operation subclass that implements the app refresh operation. If you want to use this approach, you’d create your own subclass of Operation and then implement the main() method on that. For example: final class RefreshAppContentsOperation: Operation { override func main() { … your code here … } } However, there are other approaches you might adopt. For example, you might start a Task and run Swift async code within that task. Note The term task is overloaded in this context. The Background Tasks framework uses it to refer to the state that’s tracking the work and Swift concurrency uses it to refer to the state of the code that’s actually doing the work. [quote='786186021, marcofusco111, /t
Topic:
App & System Services
SubTopic:
Processes & Concurrency
Tags: