what's new in Swift?

Asked on 06/16/2025

2 searches

At WWDC, Apple introduced several new features and improvements in Swift, particularly with the release of Swift 6 and Swift 6.2. Here are some of the highlights:

  1. Swift 6 Language Mode: This new mode introduces data race safety, which helps in writing correct concurrent programs by diagnosing data races at compile time. This feature is opt-in, allowing developers to adopt it when ready.

  2. Embedded Swift: A new subset of Swift designed for highly constrained systems, such as firmware for embedded devices and operating system kernels. It supports core Swift features like value and reference types, closures, optionals, and more.

  3. Development Workflow Improvements: Swift 6.2 brings enhancements to writing, building, and debugging code. For example, the Swift extension in VS Code now supports background indexing, improving editor features like "Jump to Definition."

  4. Library Updates: Swift 6.2 modernizes more of Foundation's API surface and introduces new APIs for everyday programming tasks, such as launching subprocesses.

  5. Performance Enhancements: Swift 6.2 introduces inline arrays, which allow arrays with a fixed size to be stored on the stack, unlocking compiler optimizations for performance gains. A new span type provides a safe alternative to pointers for fast memory access.

  6. Concurrency Improvements: Swift continues to evolve its concurrency model, making it more approachable and capable for performance-critical code.

  7. Non-Copyable Types: Swift 6 introduces non-copyable types, which are not copyable by default, enhancing memory safety and performance.

For more detailed information, you can refer to the sessions What’s new in Swift and What’s new in Swift.