forked from intitni/CopilotForXcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAppInfoView.swift
More file actions
57 lines (50 loc) · 1.85 KB
/
AppInfoView.swift
File metadata and controls
57 lines (50 loc) · 1.85 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
57
import SwiftUI
struct AppInfoView: View {
@State var appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String
@Environment(\.updateChecker) var updateChecker
var body: some View {
Section {
VStack(alignment: .leading) {
HStack(alignment: .top) {
Text("Copilot For Xcode")
.font(.title)
Text(appVersion ?? "")
.font(.footnote)
.foregroundColor(.white.opacity(0.5))
Spacer()
Button(action: {
updateChecker.checkForUpdates()
}) {
HStack(spacing: 2) {
Image(systemName: "arrow.up.right.circle.fill")
Text("Check for Updates")
}
}
.buttonStyle(.copilot)
}
HStack(spacing: 16) {
Link(destination: URL(string: "https://github.com/intitni/CopilotForXcode")!) {
HStack(spacing: 2) {
Image(systemName: "link")
Text("GitHub")
}
}
.focusable(false)
Link(destination: URL(string: "https://www.buymeacoffee.com/intitni")!) {
HStack(spacing: 2) {
Image(systemName: "cup.and.saucer.fill")
Text("Buy Me A Coffee")
}
}
.focusable(false)
}
}
}
}
}
struct AppInfoView_Preview: PreviewProvider {
static var previews: some View {
AppInfoView()
.background(.black)
}
}