Last active
December 31, 2019 00:37
-
-
Save licvido/4e4633c8ea119e92e359 to your computer and use it in GitHub Desktop.
SWIFT: Get application version and build
This file contains 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
let version : AnyObject! = NSBundle.mainBundle().objectForInfoDictionaryKey("CFBundleShortVersionString") | |
let build : AnyObject! = NSBundle.mainBundle().objectForInfoDictionaryKey("CFBundleVersion") | |
println("Version: \(version)") | |
println("Build: \(build)") |
iballan
commented
Jun 5, 2017
// Swift 4
let version : Any! = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString")
let build : Any! = Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion")
print("Version: \(version)")
print("Build: \(build)")
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment