-//
-// MapApp.swift
-// Map
-//
-// Created by Ruben Beltran del Rio on 2/1/21.
-//
-
import SwiftUI
+import Sparkle
@main
struct MapApp: App {
- let persistenceController = PersistenceController.shared
-
+
+ private let updaterController: SPUStandardUpdaterController = SPUStandardUpdaterController(startingUpdater: true, updaterDelegate: nil, userDriverDelegate: nil)
+
var body: some Scene {
- WindowGroup {
- MapEditorWindow()
- .environment(\.managedObjectContext, persistenceController.container.viewContext)
- .environmentObject(AppStore(initialState: AppState(), reducer: appStateReducer))
- }.windowStyle(HiddenTitleBarWindowStyle()).commands {
- SidebarCommands()
+ DocumentGroup(newDocument: MapDocument()) { file in
+ MapEditor(document: file.$document, url: file.fileURL)
+ }.commands {
+ MapCommands()
+ UpdateCommands(updaterController: updaterController)
}
}
}