-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathApp.swift
More file actions
36 lines (30 loc) · 1.01 KB
/
App.swift
File metadata and controls
36 lines (30 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import Client
import HostApp
import LaunchAgentManager
import SharedUIComponents
import SwiftUI
import UpdateChecker
import XPCShared
struct VisualEffect: NSViewRepresentable {
func makeNSView(context: Self.Context) -> NSView { return NSVisualEffectView() }
func updateNSView(_ nsView: NSView, context: Context) { }
}
class AppDelegate: NSObject, NSApplicationDelegate {
func applicationShouldTerminateAfterLastWindowClosed(_: NSApplication) -> Bool { true }
}
@main
struct CopilotForXcodeApp: App {
@NSApplicationDelegateAdaptor private var appDelegate: AppDelegate
var body: some Scene {
WindowGroup {
TabContainer()
.frame(minWidth: 800, minHeight: 600)
.background(VisualEffect().ignoresSafeArea())
.onAppear {
UserDefaults.setupDefaultSettings()
}
.copilotIntroSheet()
}
}
}
var isPreview: Bool { ProcessInfo.processInfo.environment["XCODE_RUNNING_FOR_PREVIEWS"] == "1" }