Skip to content

Instantly share code, notes, and snippets.

@danielgalasko
Last active February 16, 2016 07:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielgalasko/341191a466375f676eaa to your computer and use it in GitHub Desktop.
Save danielgalasko/341191a466375f676eaa to your computer and use it in GitHub Desktop.
Retrieve an iOS App version and build number
struct AppInfo {
static func buildNumber() -> String {
return AppInfo.infoDictionary["CFBundleVersion"] as! String
}
static func versionNumber() -> String {
return AppInfo.infoDictionary["CFBundleShortVersionString"]as! String
}
private static var infoDictionary: [NSObject: AnyObject] {
return NSBundle.mainBundle().infoDictionary!
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment