forked from intitni/CopilotForXcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.swift
More file actions
37 lines (33 loc) · 1.04 KB
/
App.swift
File metadata and controls
37 lines (33 loc) · 1.04 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
36
37
import Client
import SwiftUI
import UpdateChecker
import XPCShared
@main
struct CopilotForXcodeApp: App {
var body: some Scene {
WindowGroup {
ContentView()
.frame(minWidth: 500, minHeight: 700)
.preferredColorScheme(.dark)
.onAppear {
UserDefaults.setupDefaultSettings()
Task {
let service = try getService()
await service.boostQoS()
}
}
.environment(\.updateChecker, UpdateChecker(hostBundle: Bundle.main))
}
.windowStyle(.hiddenTitleBar)
}
}
var isPreview: Bool { ProcessInfo.processInfo.environment["XCODE_RUNNING_FOR_PREVIEWS"] == "1" }
struct UpdateCheckerKey: EnvironmentKey {
static var defaultValue: UpdateChecker = .init(hostBundle: nil)
}
extension EnvironmentValues {
var updateChecker: UpdateChecker {
get { self[UpdateCheckerKey.self] }
set { self[UpdateCheckerKey.self] = newValue }
}
}