How can I programmatically get the value of the target version, like in the image below?
As seen in the Properties window of the target of my Xcode proj
I made an extension for Bundle so it will be easy to use
extension Bundle {
var releaseVersionNumber: String? {
return infoDictionary?["CFBundleShortVersionString"] as? String
}
var buildVersionNumber: String? {
return infoDictionary?["CFBundleVersion"] as? String
}
var applicationName: String {
return infoDictionary?["CFBundleDisplayName"] as? String ?? "ADKATech"
}
var applicationReleaseDate: String {
return infoDictionary?["ApplicationReleaseDate"] as? String ?? Date().description
}
var applicationReleaseNumber: Int {
return infoDictionary?["ApplicationReleaseNumber"] as? Int ?? 0
}
var releaseVersionNumberPretty: String {
return "\(releaseVersionNumber ?? "1.0.0")"
}
var buildVersionNumberPretty: String {
return "\(buildVersionNumber ?? "1")"
}
}