File tree Expand file tree Collapse file tree
DevLogPresentation/Sources/Settings Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,13 +33,23 @@ struct SettingsFeature {
3333 var activeLoadingRow : ActiveLoadingRow ?
3434 var loading = LoadingFeature . State ( )
3535 var alertType : Action . AlertType ?
36- var appVersion = Bundle . main . infoDictionary ? [ " CFBundleShortVersionString " ] as? String
36+ var appVersion = Self . appVersion ( )
3737 var appstoreUrl = Bundle . main. object ( forInfoDictionaryKey: " TESTFLIGHT_URL " ) as? String
3838 var policyURL = Bundle . main. object ( forInfoDictionaryKey: " PRIVACY_POLICY_URL " ) as? String
3939
4040 var isLoading : Bool {
4141 loading. isLoading
4242 }
43+
44+ private static func appVersion( ) -> String ? {
45+ let marketingVersion = Bundle . main. object ( forInfoDictionaryKey: " CFBundleShortVersionString " ) as? String
46+ let buildNumber = Bundle . main. object ( forInfoDictionaryKey: " CFBundleVersion " ) as? String
47+ let components = [ marketingVersion, buildNumber]
48+ . compactMap { $0? . trimmingCharacters ( in: . whitespacesAndNewlines) }
49+ . filter { !$0. isEmpty }
50+
51+ return components. isEmpty ? nil : components. joined ( separator: " . " )
52+ }
4353 }
4454
4555 enum Action : BindableAction {
Original file line number Diff line number Diff line change 1- MARKETING_VERSION = 1.2.6
1+ MARKETING_VERSION = 1.3
22IPHONEOS_DEPLOYMENT_TARGET = 17.0
You can’t perform that action at this time.
0 commit comments