Skip to content

Instantly share code, notes, and snippets.

@AhiyaHiya
Last active August 5, 2017 23:54
Show Gist options
  • Select an option

  • Save AhiyaHiya/27614ec4780482c79f7afc7d75838433 to your computer and use it in GitHub Desktop.

Select an option

Save AhiyaHiya/27614ec4780482c79f7afc7d75838433 to your computer and use it in GitHub Desktop.
A function I use to update version string on the layout.
@implementation VersionStringDemo
- (void)updateVersionLabel
{
NSString* version =
[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
NSString* build =
[[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString*)kCFBundleVersionKey];
NSString* versionString = [NSString stringWithFormat:@"Version: %@ Build: %@", version, build];
[_versionLabel setText:versionString];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment