mirror of
https://github.com/carey314/mio-plugin-airdrop.git
synced 2026-06-11 03:54:33 +00:00
35 lines
901 B
Swift
35 lines
901 B
Swift
|
|
//
|
||
|
|
// AirDropPlugin.swift
|
||
|
|
// MioIsland AirDrop Plugin
|
||
|
|
//
|
||
|
|
// Principal class. Module is `AirDropPlugin`, class is `AirDropPlugin`,
|
||
|
|
// so Info.plist NSPrincipalClass = "AirDropPlugin.AirDropPlugin".
|
||
|
|
//
|
||
|
|
// Wraps NSSharingService(.sendViaAirDrop) — a public Apple API — in a
|
||
|
|
// Mio Island panel. No private APIs, no entitlements, no network.
|
||
|
|
//
|
||
|
|
|
||
|
|
import AppKit
|
||
|
|
import SwiftUI
|
||
|
|
|
||
|
|
final class AirDropPlugin: NSObject, MioPlugin {
|
||
|
|
var id: String { "airdrop" }
|
||
|
|
var name: String { "AirDrop" }
|
||
|
|
var icon: String { "airplayaudio" }
|
||
|
|
var version: String { "1.0.0" }
|
||
|
|
|
||
|
|
func activate() {
|
||
|
|
NSLog("[mio-plugin-airdrop] activate")
|
||
|
|
}
|
||
|
|
|
||
|
|
func deactivate() {
|
||
|
|
NSLog("[mio-plugin-airdrop] deactivate")
|
||
|
|
}
|
||
|
|
|
||
|
|
func makeView() -> NSView {
|
||
|
|
let view = NSHostingView(rootView: ExpandedView())
|
||
|
|
view.autoresizingMask = [.width, .height]
|
||
|
|
return view
|
||
|
|
}
|
||
|
|
}
|