Files
Bitcoin-Monitoring/test1/test1App.swift
2025-10-28 21:13:13 +08:00

44 lines
965 B
Swift
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//
// test1App.swift
// test1
//
// Created by zl_vm on 2025/10/28.
//
import SwiftUI
import AppKit
@main
struct test1App: App {
@NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
var body: some Scene {
Settings {
EmptyView()
}
}
}
class AppDelegate: NSObject, NSApplicationDelegate {
var menuBarApp: BTCMenuBarApp?
func applicationDidFinishLaunching(_ notification: Notification) {
// Dock
NSApp.setActivationPolicy(.accessory)
//
if let window = NSApp.windows.first {
window.setIsVisible(false)
}
//
menuBarApp = BTCMenuBarApp()
}
func applicationShouldTerminate(_ sender: NSApplication) -> NSApplication.TerminateReply {
//
menuBarApp = nil
return .terminateNow
}
}