Last active
February 16, 2016 07:48
-
-
Save danielgalasko/341191a466375f676eaa to your computer and use it in GitHub Desktop.
Retrieve an iOS App version and build number
This file contains hidden or 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
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