forked from github/CopilotForXcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChatNoAXPermissionView.swift
More file actions
56 lines (49 loc) · 1.91 KB
/
ChatNoAXPermissionView.swift
File metadata and controls
56 lines (49 loc) · 1.91 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import SwiftUI
import Perception
import SharedUIComponents
struct ChatNoAXPermissionView: View {
@Environment(\.openURL) private var openURL
var body: some View {
WithPerceptionTracking {
VStack(spacing: 0) {
VStack(alignment: .center, spacing: 20) {
Spacer()
Image("CopilotError")
.resizable()
.renderingMode(.template)
.scaledToFill()
.scaledFrame(width: 64.0, height: 64.0)
.foregroundColor(.primary)
Text("Accessibility Permission Required")
.scaledFont(.largeTitle)
.multilineTextAlignment(.center)
Text("Please grant accessibility permission for Github Copilot to work with Xcode.")
.scaledFont(.body)
.multilineTextAlignment(.center)
HStack{
Button("Open Permission Settings") {
if let url = URL(string: "x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility") {
openURL(url)
}
}
.scaledFont(.body)
.buttonStyle(.borderedProminent)
}
Spacer()
}
.padding()
.frame(
maxWidth: .infinity,
maxHeight: .infinity
)
}
.xcodeStyleFrame()
.ignoresSafeArea(edges: .top)
}
}
}
struct ChatNoAXPermission_Previews: PreviewProvider {
static var previews: some View {
ChatNoAXPermissionView()
}
}