diff --git a/Application/DevLogPresentation/Sources/Settings/SettingsFeature.swift b/Application/DevLogPresentation/Sources/Settings/SettingsFeature.swift index 25baa805..061235b8 100644 --- a/Application/DevLogPresentation/Sources/Settings/SettingsFeature.swift +++ b/Application/DevLogPresentation/Sources/Settings/SettingsFeature.swift @@ -33,13 +33,23 @@ struct SettingsFeature { var activeLoadingRow: ActiveLoadingRow? var loading = LoadingFeature.State() var alertType: Action.AlertType? - var appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String + var appVersion = Self.appVersion() var appstoreUrl = Bundle.main.object(forInfoDictionaryKey: "TESTFLIGHT_URL") as? String var policyURL = Bundle.main.object(forInfoDictionaryKey: "PRIVACY_POLICY_URL") as? String var isLoading: Bool { loading.isLoading } + + private static func appVersion() -> String? { + let marketingVersion = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String + let buildNumber = Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as? String + let components = [marketingVersion, buildNumber] + .compactMap { $0?.trimmingCharacters(in: .whitespacesAndNewlines) } + .filter { !$0.isEmpty } + + return components.isEmpty ? nil : components.joined(separator: ".") + } } enum Action: BindableAction { diff --git a/Application/Shared/Version.xcconfig b/Application/Shared/Version.xcconfig index 894ea785..37b94782 100644 --- a/Application/Shared/Version.xcconfig +++ b/Application/Shared/Version.xcconfig @@ -1,2 +1,2 @@ -MARKETING_VERSION = 1.2.6 +MARKETING_VERSION = 1.3 IPHONEOS_DEPLOYMENT_TARGET = 17.0