Skip to content

Instantly share code, notes, and snippets.

@jamztang
Last active August 29, 2015 14:07
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 jamztang/7fc61f30c17022b1b550 to your computer and use it in GitHub Desktop.
Save jamztang/7fc61f30c17022b1b550 to your computer and use it in GitHub Desktop.
NSString *version = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
[[NSUserDefaults standardUserDefaults] setObject:version
forKey:@"version_preference"];
NSString *build = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"];
[[NSUserDefaults standardUserDefaults] setObject:build
forKey:@"build_preference"];
NSString *githash = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"GITHash"];
[[NSUserDefaults standardUserDefaults] setObject:githash
forKey:@"githash_preference"];
let version = NSBundle.mainBundle().objectForInfoDictionaryKey("CFBundleShortVersionString")
NSUserDefaults.standardUserDefaults().setObject(version, forKey: "version_preference")
let build = NSBundle.mainBundle().objectForInfoDictionaryKey("CFBundleVersion")
NSUserDefaults.standardUserDefaults().setObject(build, forKey: "build_preference")
let githash = NSBundle.mainBundle().objectForInfoDictionaryKey("GITHash")
NSUserDefaults.standardUserDefaults().setObject(githash, forKey: "githash_preference")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment