Skip to content

Commit

Permalink
Merge pull request #8 from steamclock/jm/CFBundleDisplayName-fallback
Browse files Browse the repository at this point in the history
Use CFBundleName as fallback when CFBundleDisplayName is nil
  • Loading branch information
jacobminer authored Jul 5, 2018
2 parents e7ff509 + f7e4b72 commit 5022c1b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Switchcraft.podspec
Original file line number Diff line number Diff line change
@@ -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' }
Expand Down
14 changes: 7 additions & 7 deletions Switchcraft/Classes/Config.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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".
Expand Down

0 comments on commit 5022c1b

Please sign in to comment.