
Swift is designed to be the language you reach for at every layer of the software stack. Whether you’re building embedded firmware, internet-scale services, or full-featured mobile apps, Swift delivers strong safety guarantees, performance control when you need it, and expressive language features and APIs.
Swift 6.3 makes these benefits more accessible across the stack. This release expands Swift into new domains and improves developer ergonomics across the board, featuring:
Read on for an overview of the changes and next steps to get started.
Swift 6.3 introduces the @c attribute, which lets you expose Swift functions and enums to C code in your project. Annotating a function or enum with @c prompts Swift to include a corresponding declaration in the generated C header that you can include in your C/C++ files:
@c
func callFromC() { ... }
// Generated C header
void callFromC(void);
You can provide a custom name to use for the generated C declaration:
@c(MyLibrary_callFromC)
func callFromC() { ... }
// Generated C header
void MyLibrary_callFromC(void);
@c also works together with @implementation. This lets you provide a Swift implementation for a function declared in a C header:
// C header
void callFromC(void);
// Implementation written in Swift
@c @implementation
func callFromC() { ... }
When using @c together with @implementation, Swift will validate that the Swift function matches a pre-existing declaration in a C header, rather than including a C declaration in the generated header.
Swift 6.3 introduces module selectors to specify which imported module Swift should look in for an API used in your code. If you import more than one module that provides API with the same name, module selectors let you disambiguate which API to use:
import ModuleA
import ModuleB
let x = ModuleA::getValue() // Call 'getValue' from ModuleA
let y = ModuleB::getValue() // Call 'getValue' from ModuleB
Swift 6.3 also enables using the Swift module name to access concurrency and String processing library APIs:
let task = Swift::Task {
// async work
}
Swift 6.3 introduces new attributes that give library authors finer-grained control over compiler optimizations for clients of their APIs:
@specialize.@inline(always). Use this attribute only when you’ve determined that the benefits of inlining outweigh any increase in code size.@export(implementation). This allows the function to participate in more compiler optimizations.For a full list of language evolution proposals in Swift 6.3, see the Swift Evolution dashboard.
Swift 6.3 includes a preview of Swift Build integrated into Swift Package Manager. This preview brings a unified build engine across all supported platforms for a more consistent cross-platform development experience. To learn more, check out Preview the Swift Build System Integration. We encourage you to try it in your own packages and report any issues you encounter.
Swift 6.3 also brings the following Swift Package Manager improvements:
swift package show-traits command.For more information on changes to Swift Package Manager, see the SwiftPM 6.3 Release Notes.
Swift Testing has a number of improvements, including warning issues, test cancellation, and image attachments.
severity parameter to Issue.record. You can record an issue as a warning using Issue.record("Something suspicious happened", severity: .warning). This is reflected in the test’s results, but doesn’t mark the test as a failure.try Test.cancel(). This is helpful for skipping individual arguments of a parameterized test, or responding to conditions during a test that indicate it shouldn’t proceed.The list of Swift Testing evolution proposals included in Swift 6.3 are ST-0012, ST-0013, ST-0014, ST-0015, ST-0016, ST-0017, and ST-0020.
Swift 6.3 adds three new experimental capabilities to DocC:
--enable-experimental-markdown-output to docc convert.<noscript> tag. This improves discoverability by search engines and accessibility for screen readers without requiring JavaScript. Try it out by passing --transform-for-static-hosting --experimental-transform-for-static-hosting-with-content to docc convert.Code block annotations: Unlock new formatting annotations for code blocks, including nocopy for disabling copy-to-clipboard, highlight to highlight specific lines by number, showLineNumbers to display line numbers, and wrap to wrap long lines by column width. Specify these options in a comma-separated list after the language name on the opening fence line:
```swift, nocopy
let config = loadDefaultConfig()
```
```swift, highlight=[1, 3]
let name = "World" // highlighted
let greeting = "Hello"
print("\(greeting), \(name)!") // highlighted
```
```swift, showLineNumbers, wrap=80
func example() { /* ... */ }
```
DocC validates line indices and warns about unrecognized options. Try out the new code block annotations with --enable-experimental-code-block-annotations.
Embedded Swift has a wide range of improvements in Swift 6.3, from enhanced C interoperability and better debugging support to meaningful steps toward a complete linkage model. For a detailed look at what’s new in embedded Swift, see Embedded Swift Improvements coming in Swift 6.3.
Swift 6.3 includes the first official release of the Swift SDK for Android. With this SDK, you can start developing native Android programs in Swift, update your Swift packages to support building for Android, and use Swift Java and Swift Java JNI Core to integrate Swift code into existing Android applications written in Kotlin/Java. This is a significant milestone that opens new opportunities for cross-platform development in Swift.
To learn more and try out Swift for Android development in your own projects, see Getting Started with the Swift SDK for Android.
Swift 6.3 reflects the contributions of many people across the Swift community — through code, proposals, forum discussions, and feedback from real-world experience. A special thank you to the Android Workgroup, whose months of effort — building on many years of grassroots community work — brought the Swift SDK for Android from nightly previews to an official release in Swift 6.3.
If you’d like to get involved in what comes next, the Swift Forums are a great place to start.
Try out Swift 6.3 today! You can find instructions for installing a Swift 6.3 toolchain on the Install Swift page.
Holly Borla is a member of the Swift Core Team and Language Steering Group, and the engineering manager of the Swift language team at Apple.
Joe Heck works on Swift as part of the Open Source Program Office at Apple.