mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-07-24 17:20:51 +02:00
feat(template): add mobile projects, build script, fill initial src code (#305)
This commit is contained in:
committed by
GitHub
parent
0fed10fdce
commit
775581d824
@@ -0,0 +1,16 @@
|
||||
import UIKit
|
||||
import WebKit
|
||||
import Tauri
|
||||
import SwiftRs
|
||||
|
||||
class ExamplePlugin: Plugin {
|
||||
@objc public func ping(_ invoke: Invoke) throws {
|
||||
let value = invoke.getString("value")
|
||||
invoke.resolve(["value": value as Any])
|
||||
}
|
||||
}
|
||||
|
||||
@_cdecl("init_plugin_{{ plugin_name_snake_case }}")
|
||||
func initPlugin(name: SRString, webview: WKWebView?) {
|
||||
Tauri.registerPlugin(webview: webview, name: name.toString(), plugin: ExamplePlugin())
|
||||
}
|
||||
Reference in New Issue
Block a user