Swift extension? #6223
-
Hey there! I'd like to build a Tauri app exclusively for macOS. I'm choosing the web stack simply because it's quicker to prototype in. For this app, I would need to create an extension in Swift. I'll be communicating with some native APIs and such. I already pretty much have the Swift code needed. I'm hoping for something like Capacitor plugins. How could I go about accomplishing this in Tauri? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
So unless you wanna have a localhost server in your swift parts, i guess the only real solution here is https://crates.io/crates/swift-rs. Edit: forgot to mention the "standard" sidecar approach, using stdio instead of a localhost server. https://tauri.app/v1/guides/building/sidecar |
Beta Was this translation helpful? Give feedback.
-
To use native Swift code in a Tauri app, you can create a Tauri plugin. A Tauri plugin is a separate Rust crate that provides additional functionality to your Tauri app. It can be used to interface with native code, like Swift code in your case. |
Beta Was this translation helpful? Give feedback.
So unless you wanna have a localhost server in your swift parts, i guess the only real solution here is https://crates.io/crates/swift-rs.
Edit: forgot to mention the "standard" sidecar approach, using stdio instead of a localhost server. https://tauri.app/v1/guides/building/sidecar