Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
UIApplication extensions. Bundle marketing and build versions
extension UIApplication {
static var appVersion: String? {
return Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String
}
static var buildVersion: String? {
return Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as? String
}
static var fullVersion: String? {
guard
let marketingVersion = appVersion,
let buildNumber = buildVersion else {
return nil
}
return "\(marketingVersion)(\(buildNumber))"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.