Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Allow macOS plugins to be written in Swift #12137

Open
velocitysystems opened this issue Jan 2, 2025 · 2 comments
Open

[feat] Allow macOS plugins to be written in Swift #12137

velocitysystems opened this issue Jan 2, 2025 · 2 comments

Comments

@velocitysystems
Copy link

velocitysystems commented Jan 2, 2025

Describe the problem

Swift support is not available for macOS plugins. It is only available for iOS plugins.

Describe the solution you'd like

Since there are no production-ready Rust bindings for the macOS SDK, Swift support is needed for access to native APIs.

While Cacao is available for beta use, it is not exhaustive nor actively maintained e.g. Compared with windows-rs which is actively supported by contributors from Microsoft.

Alternatives considered

N/A

Additional context

See related discussion.

@velocitysystems
Copy link
Author

velocitysystems commented Jan 15, 2025

I'm inclined to close #12138 in favor of #4670 tbh. Same for #12137. In both cases i assume this is derived from the mobile plugin swift/kotlin support but that doesn't translate well to desktop. On mobile, tauri apps are actually kotlin / swift apps that we inject tauri into. On desktop there's really just rust, so even for the seemingly native languages in question here the approach would be the same as for all other languages.

Originally posted by @FabianLars in #12138 (comment)

While windows-rs provides Rust bindings for the Windows API there is no equivalent for AppKit on macOS other than Cacao (experimental) and core-foundation-rs which provides Rust bindings to Core Foundation and other low level libraries.

It would be far more useful to enable Swift language interop for macOS similiar to how it is implemented for iOS. This would simplify design and allow better code-sharing between iOS and macOS platforms.

@FabianLars
Copy link
Member

I can only repeat what i said in the other issue. There's nothing we can just "enable" here, there's no swift involved in tauri apps on macos.

On iOS we use https://github.com/Brendonovich/swift-rs but that's only half of it because again, on iOS we're actually in a swift app context already.

The approach would be similar to what's shown in swift-rs' readme probably, at which point we're once again talking about #4670

If you have other ideas how to "enable" swift in a non-swift app, please enlighten me as i'm def not against it, i just don't see a way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants