SHARE
TWEET

Untitled

a guest Jun 17th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as! String
  2.      
  3. NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
  4.      
  5. let version = NSBundle.mainBundle().infoDictionary?["CFBundleShortVersionString"] as! String
  6.      
  7. let build = Bundle.main.infoDictionary?[kCFBundleVersionKey as String] as? String
  8.      
  9. NSString *build = [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString *)kCFBundleVersionKey];
  10.      
  11. let build = NSBundle.mainBundle().infoDictionary?[kCFBundleVersionKey as String] as! String
  12.      
  13. NSDictionary *infoDictionary = [[NSBundle mainBundle]infoDictionary];
  14.  
  15. NSString *version = infoDictionary[@"CFBundleShortVersionString"];
  16. NSString *build = infoDictionary[(NSString*)kCFBundleVersionKey];
  17. NSString *bundleName = infoDictionary[(NSString *)kCFBundleNameKey];
  18.      
  19. struct utsname systemInfo;
  20. uname(&systemInfo);
  21.  
  22. NSDateFormatter *formatter = [[NSDateFormatter alloc]  init];
  23. NSDate  *date = [NSDate date];
  24. [formatter setDateFormat:@"MM/dd/yyyy 'at' hh:mm a"];
  25. NSString *dateString = [formatter stringFromDate:date];
  26.  
  27. CGRect screenRect = [[UIScreen mainScreen] bounds];
  28. CGFloat screenWidth = screenRect.size.width - 65.0;
  29.  
  30. NSString *comments = NSLocalizedString(@"Please write your comments below:", nil);
  31. NSString *build = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
  32. NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
  33. NSString *appName = [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString*)kCFBundleNameKey];
  34. NSString *deviceModel = [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];
  35. NSString *iOSVersion = [[UIDevice currentDevice] systemVersion];
  36.  
  37. NSString *emailBody = [NSString stringWithFormat:@"<!DOCTYPE html><html><style> .div {background-color: lightgrey; width: %fpx; padding: 10px; border: 5px solid navy; margin: 2px;}</style><body><div class='div'><p><b>App:</b> %@</p><b><p>Device:</b> %@</p><b><p>iOS Version:</b> %@</p><b><p><p>App Version and Build:</b> %@ (%@)</p><b><p>Date:</b> %@</p> </p></div><font color='red'><b>%@</b></font><br><br></body></html>",screenWidth,appName,deviceModel,iOSVersion,version,build,dateString,comments];
  38.  
  39. [self setMessageBody:emailBody isHTML:YES];
  40.      
  41. let versionNumber = NSBundle.mainBundle().objectForInfoDictionaryKey("CFBundleShortVersionString") as! String
  42. let buildNumber = NSBundle.mainBundle().objectForInfoDictionaryKey("CFBundleVersion") as! String
  43.      
  44. extension UIApplication {
  45.     class var Build: String? {
  46.         get {
  47.             return Bundle.main.infoDictionary?[kCFBundleVersionKey as String] as? String
  48.         }
  49.     }
  50.  
  51.     class var Version: String? {
  52.         get {
  53.             return Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String
  54.         }
  55.     }
  56. }
  57.      
  58. print("Version (UIApplication.Version!)")
  59. print("Build (UIApplication.Build!)")
  60.      
  61. NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
  62.      
  63. NSString *buildVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top