When did Tasks not require capturing self explicitly anymore?
Asked on 06/14/2025
1 search
Tasks no longer require capturing self
explicitly starting with Swift 6. This change is part of the improvements in Swift concurrency, which were discussed in the session titled "Migrate your app to Swift 6" at WWDC 2024. The session covers various aspects of Swift 6, including data-race safety and concurrency features. You can find more details in the chapter on "Enabling complete checking in the watch extension" and "Enabling the Swift 6 language mode in CoffeeKit" within the session.

Migrate your app to Swift 6
Experience Swift 6 migration in action as we update an existing sample app. Learn how to migrate incrementally, module by module, and how the compiler helps you identify code that’s at risk of data races. Discover different techniques for ensuring clear isolation boundaries and eliminating concurrent access to shared mutable state.

Demystify explicitly built modules
Explore how builds are changing in Xcode 16 with explicitly built modules. Discover how modules are used to build your code, how explicitly built modules improve transparency in compilation tasks, and how you can optimize your build by sharing modules across targets.

Finish tasks in the background
Discover background execution advancements and understand how the system schedules runtime. We’ll discuss how to get the most out of background runtime to allow your app to deliver features in the background while maintaining a great foreground experience. We’ll also cover how APIs provide background runtime for your app, and how each API is tailored for different use cases — including new APIs in iOS and iPadOS 26 that let your app finish tasks as your app transitions from the foreground to the background.