Download packages/tauri/examples/api/src-tauri/tauri-plugin-sample/ios/Sources/ExamplePlugin.swift from echodict/readest: direct link, hf CLI and curl.
- Browser
- Download file 594 Bytes
-
https://huggingface.co/datasets/echodict/readest/resolve/main/packages/tauri/examples/api/src-tauri/tauri-plugin-sample/ios/Sources/ExamplePlugin.swift
- Command line
-
hf download hf://datasets/echodict/readest/packages/tauri/examples/api/src-tauri/tauri-plugin-sample/ios/Sources/ExamplePlugin.swift
-
curl -L -o ExamplePlugin.swift https://huggingface.co/datasets/echodict/readest/resolve/main/packages/tauri/examples/api/src-tauri/tauri-plugin-sample/ios/Sources/ExamplePlugin.swift
594 Bytes
| // Copyright 2019-2024 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 { | |
| let value: String? | |
| let onEvent: Channel? | |
| } | |
| class ExamplePlugin: Plugin { | |
| @objc public func ping(_ invoke: Invoke) throws { | |
| let args = try invoke.parseArgs(PingArgs.self) | |
| try args.onEvent?.send(["kind": "ping"]) | |
| invoke.resolve(["value": args.value ?? ""]) | |
| } | |
| } | |
| ("init_plugin_sample") | |
| func initPlugin() -> Plugin { | |
| return ExamplePlugin() | |
| } | |