forked from github/CopilotForXcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContentView.swift
More file actions
29 lines (27 loc) · 722 Bytes
/
ContentView.swift
File metadata and controls
29 lines (27 loc) · 722 Bytes
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
import SwiftUI
import Client
struct ContentView: View {
@State var text: String = "Hello, world!"
var body: some View {
VStack {
Button(action: {
Task {
do {
let service = try getService()
let version = try await service.getXPCServiceVersion()
text = "Version: \(version.version) Build: \(version.build)"
} catch {
text = error.localizedDescription
}
}
}) {
Text("Test")
}
Text(text)
}
.padding()
}
}
#Preview {
ContentView()
}