mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-03 10:11:15 +02:00
16 lines
378 B
Swift
16 lines
378 B
Swift
import MetalKit
|
|
import WebKit
|
|
import Tauri
|
|
|
|
class ExamplePlugin: Plugin {
|
|
@objc public func ping(_ invoke: Invoke) throws {
|
|
let value = invoke.getString("value")
|
|
invoke.resolve(.dictionary(["value": value as Any]))
|
|
}
|
|
}
|
|
|
|
@_cdecl("init_plugin_sample")
|
|
func initPlugin(webview: WKWebView?) {
|
|
Tauri.registerPlugin(webview: webview, name: "sample", plugin: ExamplePlugin())
|
|
}
|