flutter ios target build version codemagic code example
Example: swift get app version and build
import Foundation
extension Bundle {
var shortVersion: String {
if let result = infoDictionary?["CFBundleShortVersionString"] as? String {
return result
} else {
assert(false)
return ""
}
}
var buildVersion: String {
if let result = infoDictionary?["CFBundleVersion"] as? String {
return result
} else {
assert(false)
return ""
}
}
var fullVersion: String {
return "\(shortVersion)(\(buildVersion))"
}
}
someLabel.text = Bundle.main.versionNumber