Created
June 13, 2015 07:45
-
-
Save tuchangwei/0d0387d4657ac5ea1447 to your computer and use it in GitHub Desktop.
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
+ (NSString *) appVersion | |
{ | |
return [[NSBundle mainBundle] objectForInfoDictionaryKey: @"CFBundleShortVersionString"]; | |
} | |
+ (NSString *) build | |
{ | |
return [[NSBundle mainBundle] objectForInfoDictionaryKey: (NSString *)kCFBundleVersionKey]; | |
} | |
+ (NSString *) versionBuild | |
{ | |
NSString * version = [self appVersion]; | |
NSString * build = [self build]; | |
NSString * versionBuild = [NSString stringWithFormat: @"v%@", version]; | |
if (![version isEqualToString: build]) { | |
versionBuild = [NSString stringWithFormat: @"%@(%@)", versionBuild, build]; | |
} | |
return versionBuild; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment