-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathChatNoAXPermissionView.swift
More file actions
55 lines (48 loc) · 1.87 KB
/
ChatNoAXPermissionView.swift
File metadata and controls
55 lines (48 loc) · 1.87 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
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()
.frame(width: 64.0, height: 64.0)
.foregroundColor(.primary)
Text("Accessibility Permission Required")
.font(.largeTitle)
.multilineTextAlignment(.center)
Text("Please grant accessibility permission for Github Copilot to work with Xcode.")
.font(.body)
.multilineTextAlignment(.center)
HStack{
Button("Open Permission Settings") {
if let url = URL(string: "x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility") {
openURL(url)
}
}
.buttonStyle(.borderedProminent)
}
Spacer()
}
.padding()
.frame(
maxWidth: .infinity,
maxHeight: .infinity
)
}
.xcodeStyleFrame(cornerRadius: 10)
.ignoresSafeArea(edges: .top)
}
}
}
struct ChatNoAXPermission_Previews: PreviewProvider {
static var previews: some View {
ChatNoAXPermissionView()
}
}