From 20d229e08d36756eb3183e23c1a6993a6fd53131 Mon Sep 17 00:00:00 2001 From: Jake Date: Thu, 5 Jul 2018 10:12:11 -0700 Subject: [PATCH 1/2] Fallback to CFBundleName if CFBundleDisplayName is nil --- Switchcraft/Classes/Config.swift | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Switchcraft/Classes/Config.swift b/Switchcraft/Classes/Config.swift index 7692494..e1bbfc5 100644 --- a/Switchcraft/Classes/Config.swift +++ b/Switchcraft/Classes/Config.swift @@ -30,15 +30,15 @@ public struct Config { * Default is the current build name and version number. */ public var alertMessage: String? { - if let bundle = Bundle.main.infoDictionary, - let displayName = bundle["CFBundleDisplayName"] as? String, - let versionString = bundle["CFBundleShortVersionString"] as? String, - let buildNumber = bundle["CFBundleVersion"] as? String { - return displayName + " " + versionString + "-" + buildNumber + guard let bundle = Bundle.main.infoDictionary, + let displayName = (bundle["CFBundleDisplayName"] as? String) ?? (bundle["CFBundleName"] as? String), + let versionString = bundle["CFBundleShortVersionString"] as? String, + let buildNumber = bundle["CFBundleVersion"] as? String else { + return nil } - return nil - } + return displayName + " " + versionString + "-" + buildNumber + } /** * The alert view text field placeholder. * Default is "Enter Value". From f7e4b72b340bddbf9576bc41896b03d3dfdfe53f Mon Sep 17 00:00:00 2001 From: Jake Date: Thu, 5 Jul 2018 10:12:28 -0700 Subject: [PATCH 2/2] Bump podspec to 0.1.2 --- Switchcraft.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Switchcraft.podspec b/Switchcraft.podspec index 4996479..096db17 100644 --- a/Switchcraft.podspec +++ b/Switchcraft.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'Switchcraft' - s.version = '0.1.1' + s.version = '0.1.2' s.summary = 'Drop and go endpoint selector written in Swift.' s.homepage = 'https://github.com/steamclock/Switchcraft' s.license = { :type => 'MIT', :file => 'LICENSE' }