mirror of
https://github.com/carey314/mio-plugin-airdrop.git
synced 2026-06-11 03:54:33 +00:00
Quick-access AirDrop from the notch panel. Tap the card body, pick files via NSOpenPanel, hand off to NSSharingService(.sendViaAirDrop). No private APIs, no entitlements, no network — just a thin wrapper around the same AirDrop API Finder uses. Design constraint: drag-and-drop is intentionally not implemented. MioIsland's notch panel auto-collapses on click-outside, which breaks the Cmd-Tab-to-Finder / grab / drag-back workflow before the drop target reaches. Tap-to-choose is rock solid by comparison. Requires MioIsland host v2.2.0+ (panel size clamp floor was lowered to 120pt in that release).
23 lines
654 B
Swift
23 lines
654 B
Swift
//
|
|
// MioPlugin.swift
|
|
// MioIsland Plugin SDK (duplicated into each external plugin)
|
|
//
|
|
// At runtime, @objc protocol conformance is matched by selector
|
|
// signatures, not by module identity, so this standalone copy
|
|
// works even though the host defines its own MioPlugin protocol
|
|
// in a different Swift module.
|
|
//
|
|
|
|
import AppKit
|
|
|
|
@objc protocol MioPlugin: AnyObject {
|
|
var id: String { get }
|
|
var name: String { get }
|
|
var icon: String { get }
|
|
var version: String { get }
|
|
func activate()
|
|
func deactivate()
|
|
func makeView() -> NSView
|
|
@objc optional func viewForSlot(_ slot: String, context: [String: Any]) -> NSView?
|
|
}
|