mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-22 18:21:35 +03:00
16 lines
409 B
Swift
16 lines
409 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_{{ plugin_name_snake_case }}")
|
|
func initPlugin(webview: WKWebView?) {
|
|
Tauri.registerPlugin(webview: webview, name: "{{plugin_name}}", plugin: ExamplePlugin())
|
|
}
|