Skip to content

Add manual for Swift sources in native extensions - #697

Open
ekharkunov wants to merge 9 commits into
masterfrom
extensions-swift
Open

ekharkunov wants to merge 9 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.
The paths are set with additionalSwiftIncludePaths and
additionalFrameworkSearchPaths in the extension manifest instead of -I and -F
in swiftFlags.
…platforms

The minimum version can be raised by a package, the module name must differ
from the imported modules, an extension with only .mm and .swift files doesn't
build for other platforms, and the library artifact has no Swift. Also list both
errors for swiftFlags values and separate the troubleshooting entries.
@ekharkunov
ekharkunov marked this pull request as ready for review November 5, 2026 10:45
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T10:48:50.352993Z 3d8af48 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3d8af48a5d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread docs/en/manuals/extensions-swift.md Resolved

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