aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-02-17 00:31:42 -0600
committerIván Ávalos <avalos@disroot.org>2022-02-17 00:31:42 -0600
commitc7e934a5b215961dcd8f63b6a5586a45a91b9186 (patch)
tree482a27eb1cc4d0bfd9b1c702b9fe640817e818df
parentde9eb9dc2b932066e8ef1668d71170230edd1d38 (diff)
downloadetbsa-trackermap-mobile-c7e934a5b215961dcd8f63b6a5586a45a91b9186.tar.gz
etbsa-trackermap-mobile-c7e934a5b215961dcd8f63b6a5586a45a91b9186.tar.bz2
etbsa-trackermap-mobile-c7e934a5b215961dcd8f63b6a5586a45a91b9186.zip
Finished AboutView (still no logo)
-rw-r--r--iosApp/iosApp/Session/AboutView.swift28
1 files changed, 21 insertions, 7 deletions
diff --git a/iosApp/iosApp/Session/AboutView.swift b/iosApp/iosApp/Session/AboutView.swift
index c0f9099..7e5325b 100644
--- a/iosApp/iosApp/Session/AboutView.swift
+++ b/iosApp/iosApp/Session/AboutView.swift
@@ -9,24 +9,38 @@
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()
- HStack {
- Text("version")
- Spacer()
- Text("1.0").foregroundColor(.secondary)
+ if let version = getVersion() {
+ HStack {
+ Text("version")
+ Spacer()
+ Text(version).foregroundColor(.secondary)
+ }
}
Button {
- // TODO
+ 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 {
- // TODO
- } label: {
+ if let url = URL(string: NSLocalizedString("app-website", comment: "")) {
+ if UIApplication.shared.canOpenURL(url) {
+ UIApplication.shared.open(url, options: [:])
+ }
+ } } label: {
Label("website", systemImage: "globe")
}
}