From 2179bf95c75dd73ea607bc249f3d8bda559af643 Mon Sep 17 00:00:00 2001 From: Earl Gaspard Date: Tue, 14 Mar 2023 14:29:42 -0500 Subject: [PATCH] Show debug symbol not showing in verboseVersionString method. --- CHANGELOG.md | 8 ++++++-- Sources/Version/Bundle+Extensions.swift | 9 +++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b5d603..7679618 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## Master +## Main ##### Enhancements @@ -6,7 +6,9 @@ ##### Bug Fixes -* None +* Fix debug symbol not showing in `verboseVersionString` method. +[Earl Gaspard](https://github.com/earlgaspard) +[#121](https://github.com/BottleRocketStudios/iOS-UtiliKit/pull/121) ## 1.8.0 (2022-01-19) @@ -29,6 +31,7 @@ * None + ## 1.7.0 (2020-08-17) ##### Enhancements @@ -78,6 +81,7 @@ [Dimitar Milinski](https://github.com/dmilinski) [#81](https://github.com/BottleRocketStudios/iOS-UtiliKit/pull/81) + ## 1.6.0 (2019-08-29) ##### Enhancements diff --git a/Sources/Version/Bundle+Extensions.swift b/Sources/Version/Bundle+Extensions.swift index ee99bef..59b751c 100644 --- a/Sources/Version/Bundle+Extensions.swift +++ b/Sources/Version/Bundle+Extensions.swift @@ -35,9 +35,9 @@ public extension Bundle { } /** - Returns the verbose version number of the application. EX. version 5.0.1.123DE🐞 Debug + Returns the verbose version number of the application. EX. version 5.0.1.123 DE 🐞 Debug - Short Version EX. version 5.0.1DE🐞 Debug + Short Version EX. version 5.0.1 DE 🐞 Debug - Parameter configuration: Defaults to the standard config. This struct defines the keys used for fetching the version number - Parameter isShortVersion: A Bool value used to switch between the short and long version @@ -47,9 +47,10 @@ public extension Bundle { let version = try versionString(for: configuration, isShortVersion: isShortVersion) let environment = configuration.environmentName ?? "" - + let debugSymbol = showDebugSymbol ? " 🐞 Debug" : "" + let localizedVersionString = NSLocalizedString("version %@", comment: "Version string - %@ will be replaced with a version number. EX. 5.0.1") - let formatString = String.localizedStringWithFormat(localizedVersionString, "\(version) \(environment)") + let formatString = String.localizedStringWithFormat(localizedVersionString, "\(version) \(environment)\(debugSymbol)") return formatString }