AboutViewController.m 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //
  2. // AboutViewController.m
  3. // Apex Mobile
  4. //
  5. // Created by Ray on 14-2-26.
  6. // Copyright (c) 2014年 United Software Applications, Inc. All rights reserved.
  7. //
  8. #import "AboutViewController.h"
  9. @interface AboutViewController ()
  10. @end
  11. @implementation AboutViewController
  12. - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
  13. {
  14. self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
  15. if (self) {
  16. // Custom initialization
  17. }
  18. return self;
  19. }
  20. - (BOOL)shouldAutorotate
  21. {
  22. return YES;
  23. }
  24. - (NSUInteger)supportedInterfaceOrientations
  25. {
  26. return UIInterfaceOrientationMaskPortrait;
  27. }
  28. - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
  29. {
  30. return UIInterfaceOrientationPortrait;
  31. }
  32. - (void)viewDidLoad
  33. {
  34. [super viewDidLoad];
  35. if (@available(iOS 11,*)) {
  36. self.infoText.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
  37. } else {
  38. self.automaticallyAdjustsScrollViewInsets = NO;
  39. }
  40. NSDictionary* infoDict =[[NSBundle mainBundle] infoDictionary];
  41. NSString* versionNum =[infoDict objectForKey:@"CFBundleVersion"];
  42. versionNum = [NSString stringWithFormat:@"A%@",versionNum];
  43. self.infoText.text = [NSString stringWithFormat:NSLocalizedString(@"about_appinfo", nil),versionNum];
  44. // Do any additional setup after loading the view.
  45. }
  46. - (void)didReceiveMemoryWarning
  47. {
  48. [super didReceiveMemoryWarning];
  49. // Dispose of any resources that can be recreated.
  50. }
  51. @end