Created
January 16, 2019 23:59
-
-
Save hishma/130dd0eeaf5d6aa52137b6ff9e62a0b9 to your computer and use it in GitHub Desktop.
Provides convenience accesors to some info dictionary keys
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Provides convenience accesors to some info dictionary keys | |
extension Bundle { | |
var identifier: String? { | |
return string(forInfoDictionaryKey: "CFBundleIdentifier") | |
} | |
var displayName: String? { | |
return string(forInfoDictionaryKey: "CFBundleDisplayName") | |
} | |
var shortVersionString: String? { | |
return string(forInfoDictionaryKey: "CFBundleShortVersionString") | |
} | |
var version: String? { | |
return string(forInfoDictionaryKey: "CFBundleVersion") | |
} | |
func string(forInfoDictionaryKey key: String) -> String? { | |
return object(forInfoDictionaryKey: key) as? String | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment