1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-13 22:00:31 +05:30
yattee/Shared/YatteeApp.swift
2021-11-09 00:20:35 +01:00

34 lines
802 B
Swift

import Defaults
import SwiftUI
@main
struct YatteeApp: App {
#if os(macOS)
@NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
#endif
@StateObject private var menu = MenuModel()
var body: some Scene {
WindowGroup {
ContentView()
.environmentObject(menu)
}
#if !os(tvOS)
.handlesExternalEvents(matching: Set(["*"]))
.commands {
SidebarCommands()
CommandGroup(replacing: .newItem, addition: {})
MenuCommands(model: Binding<MenuModel>(get: { menu }, set: { _ in }))
}
#endif
#if os(macOS)
Settings {
SettingsView()
.environmentObject(InstancesModel())
}
#endif
}
}