Skip to content

Add manual for Swift sources in native extensions - #697

Draft
ekharkunov wants to merge 5 commits into
masterfrom
extensions-swift
Draft

ekharkunov wants to merge 5 commits into
masterfrom
extensions-swift

Conversation

@ekharkunov

@ekharkunov ekharkunov commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Adds a manual that describes how to write the code of a native extension in Swift for iOS and macOS: where to put the .swift files, how to call them from Objective-C++ through the generated <Module>-Swift.h header, how to use a bridging header and Swift packages from Swift, and how to set compiler options with swiftFlags, additionalSwiftIncludePaths and additionalFrameworkSearchPaths.

It also explains that the Swift runtime libraries that an older minimum iOS or macOS version lacks are added to the application automatically.

Technical changes

Describes how to put .swift files into the src folder of an extension for iOS
and macOS, call them from Objective-C++ through the generated -Swift.h header,
use a bridging header and Swift packages from Swift, and set the swiftFlags
of the ext.manifest.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant