aboutsummaryrefslogtreecommitdiff
path: root/iosApp/iosApp/Session/AboutView.swift
diff options
context:
space:
mode:
Diffstat (limited to 'iosApp/iosApp/Session/AboutView.swift')
-rw-r--r--iosApp/iosApp/Session/AboutView.swift48
1 files changed, 48 insertions, 0 deletions
diff --git a/iosApp/iosApp/Session/AboutView.swift b/iosApp/iosApp/Session/AboutView.swift
new file mode 100644
index 0000000..7e5325b
--- /dev/null
+++ b/iosApp/iosApp/Session/AboutView.swift
@@ -0,0 +1,48 @@
+//
+// AboutView.swift
+// iosApp
+//
+// Created by Iván on 15/02/22.
+// Copyright © 2022 orgName. All rights reserved.
+//
+
+import SwiftUI
+
+struct AboutView: View {
+
+ private func getVersion() -> String? {
+ return Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String
+ }
+
+ var body: some View {
+ List {
+ Text("about-text").padding()
+ if let version = getVersion() {
+ HStack {
+ Text("version")
+ Spacer()
+ Text(version).foregroundColor(.secondary)
+ }
+ }
+
+ Button {
+ if let url = URL(string: NSLocalizedString("app-source-code", comment: "")) {
+ if UIApplication.shared.canOpenURL(url) {
+ UIApplication.shared.open(url, options: [:])
+ }
+ }
+ } label: {
+ Label("source-code", systemImage: "chevron.left.forwardslash.chevron.right")
+ }
+
+ Button {
+ if let url = URL(string: NSLocalizedString("app-website", comment: "")) {
+ if UIApplication.shared.canOpenURL(url) {
+ UIApplication.shared.open(url, options: [:])
+ }
+ } } label: {
+ Label("website", systemImage: "globe")
+ }
+ }
+ }
+}