From 2a89a534fc567d573286fa09e0f5354cbf1a4b38 Mon Sep 17 00:00:00 2001 From: Lumaa Date: Sat, 27 Jan 2024 08:56:54 +0100 Subject: [PATCH] Shortened variables --- Threaded/ThreadedApp.swift | 4 ++++ Threaded/Views/Settings/AboutView.swift | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Threaded/ThreadedApp.swift b/Threaded/ThreadedApp.swift index 020532d..696e174 100644 --- a/Threaded/ThreadedApp.swift +++ b/Threaded/ThreadedApp.swift @@ -14,3 +14,7 @@ struct ThreadedApp: App { } } } + +extension AppInfo { + static var appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Unknown" +} diff --git a/Threaded/Views/Settings/AboutView.swift b/Threaded/Views/Settings/AboutView.swift index 4672fe8..c85168b 100644 --- a/Threaded/Views/Settings/AboutView.swift +++ b/Threaded/Views/Settings/AboutView.swift @@ -7,7 +7,7 @@ struct AboutView: View { var body: some View { List { - Section(footer: Text("about.version-\(Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Unknown")")) { + Section(footer: Text("about.version-\(AppInfo.appVersion)")) { NavigationLink { aboutApp } label: {