Repository navigation
Add manual for Swift sources in native extensions - #697
Draft
ekharkunov wants to merge 5 commits into
Draft
ekharkunov wants to merge 5 commits into
ekharkunov wants to merge 5 commits into
Conversation
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 was referenced Nov 4, 2026
The paths are set with additionalSwiftIncludePaths and additionalFrameworkSearchPaths in the extension manifest instead of -I and -F in swiftFlags.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a manual that describes how to write the code of a native extension in Swift for iOS and macOS: where to put the
.swiftfiles, how to call them from Objective-C++ through the generated<Module>-Swift.hheader, how to use a bridging header and Swift packages from Swift, and how to set compiler options withswiftFlags,additionalSwiftIncludePathsandadditionalFrameworkSearchPaths.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
docs/en/manuals/extensions-swift.md, listed inen.jsonafter the Swift Package Manager manual.extensions.mdmentions Swift files in the description of thesrcfolder, andextensions-ext-manifests.mdlists the newswiftFlags,additionalSwiftIncludePathsandadditionalFrameworkSearchPathskeys.