mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-01-31 00:45:24 +01:00
* chore(ios): consolidate optional argument standard mark all optional iOS arguments as `var <name>: Type?`, following the pattern described in the documentation: https://v2.tauri.app/develop/plugins/develop-mobile/#ios * chore: add missing Info.plist to example
25 lines
547 B
Swift
25 lines
547 B
Swift
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
import SwiftRs
|
|
import Tauri
|
|
import UIKit
|
|
import WebKit
|
|
|
|
class PingArgs: Decodable {
|
|
var value: String?
|
|
}
|
|
|
|
class ExamplePlugin: Plugin {
|
|
@objc public func ping(_ invoke: Invoke) throws {
|
|
let args = try invoke.parseArgs(PingArgs.self)
|
|
invoke.resolve(["value": args.value ?? ""])
|
|
}
|
|
}
|
|
|
|
@_cdecl("init_plugin_{{ plugin_name_snake_case }}")
|
|
func initPlugin() -> Plugin {
|
|
return ExamplePlugin()
|
|
}
|