From c7e934a5b215961dcd8f63b6a5586a45a91b9186 Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Thu, 17 Feb 2022 00:31:42 -0600 Subject: Finished AboutView (still no logo) --- iosApp/iosApp/Session/AboutView.swift | 28 +++++++++++++++++++++------- 1 file 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") } } -- cgit v1.2.3