How do

Generated on 7/31/2024

1 search

To migrate your app to Swift 6, you can follow the detailed guidance provided in the session titled "Migrate your app to Swift 6" from WWDC 2024. Here are the key chapters that will help you through the process:

  1. Introduction - Overview of the session.
  2. The Coffee Tracker app - Example app used for the migration.
  3. Review the refactor from WWDC21 - Revisiting previous refactors.
  4. Swift 6 and data-race safety - Introduction to data-race safety in Swift 6.
  5. Swift 6 migration in practice - Practical steps for migration.
  6. The strategy - Strategies for a smooth migration.
  7. Adopting concurrency features - How to adopt new concurrency features.
  8. Enabling complete checking in the watch extension - Ensuring thorough checking in extensions.
  9. Shared mutable state in global variables - Handling shared mutable state.
  10. Shared mutable state in global instances and functions - Managing state in instances and functions.
  11. Delegate callbacks and concurrency - Integrating delegate callbacks with concurrency.
  12. Guaranteeing data-race safety with code you don’t maintain - Ensuring safety with third-party code.
  13. Enabling the Swift 6 language mode in the watch extension - Switching to Swift 6 mode.
  14. Moving on to CoffeeKit - Applying changes to a specific module.
  15. Enabling complete checking in CoffeeKit - Ensuring thorough checking in CoffeeKit.
  16. Common patterns and an incremental strategy - Patterns and strategies for incremental migration.
  17. Global variables in CoffeeKit - Handling global variables.
  18. Sending an array between actors - Managing data transfer between actors.
  19. What if you can’t mark something as Sendable? - Handling non-Sendable types.
  20. Enabling the Swift 6 language mode in CoffeeKit - Switching to Swift 6 mode in CoffeeKit.
  21. Adding a new feature with guaranteed data-race safety - Adding features with safety guarantees.
  22. Wrap up and the Swift 6 migration guide - Summary and additional resources.

For a specific example of enabling the Swift 6 language mode in CoffeeKit, you can refer to the timestamp Enabling the Swift 6 language mode in CoffeeKit (35:23) from the session "Migrate your app to Swift 6".

Relevant Sessions

Create a custom data store with SwiftData

Create a custom data store with SwiftData

Combine the power of SwiftData’s expressive, declarative modeling API with your own persistence backend. Learn how to build a custom data store and explore how to progressively add persistence features in your app. To get the most out of this session, watch “Meet SwiftData” and “Model your schema with SwiftData” from WWDC23.

Explore wellbeing APIs in HealthKit

Explore wellbeing APIs in HealthKit

Learn how to incorporate mental health and wellbeing into your app using HealthKit. There are new APIs for State of Mind, as well as for Depression Risk and Anxiety Risk. We’ll dive into principles of emotion science to cover how reflecting on feelings can be beneficial, and how State of Mind can be used to represent different types of mood and emotion.

Port advanced games to Apple platforms

Port advanced games to Apple platforms

Discover how simple it can be to reach players on Apple platforms worldwide. We’ll show you how to evaluate your Windows executable on Apple silicon, start your game port with code samples, convert your shader code to Metal, and bring your game to Mac, iPhone, and iPad. Explore enhanced Metal tools that understand HLSL shaders to validate, debug, and profile your ported shaders on Metal.

Migrate your app to Swift 6

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.