IOSDeviceConfig.m 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //
  2. // IOSDeviceConfig.m
  3. // CommonLibrary
  4. //
  5. // Created by AlexiChen on 13-1-11.
  6. // Copyright (c) 2013年 AlexiChen. All rights reserved.
  7. //
  8. #import "IOSDeviceConfig.h"
  9. #import "FanweDeviceMacro.h"
  10. @implementation IOSDeviceConfig
  11. static IOSDeviceConfig *_sharedConfig = nil;
  12. + (IOSDeviceConfig *)sharedConfig
  13. {
  14. @synchronized(_sharedConfig)
  15. {
  16. if (_sharedConfig == nil) {
  17. _sharedConfig = [[IOSDeviceConfig alloc] init];
  18. }
  19. return _sharedConfig;
  20. }
  21. }
  22. - (void)dealloc
  23. {
  24. CommonRelease(_deviceUUID);
  25. CommonSuperDealloc();
  26. }
  27. - (id)init
  28. {
  29. if (self = [super init])
  30. {
  31. _isIPad = isIPad();
  32. _isIPhone = isIPhone();
  33. _isIPhone5 = isIPhone5();
  34. _isIOS7 = isIOS7();
  35. _isIOS8 = isIOS8();
  36. _isIOS9 = isIOS9();
  37. _isIOS10 = isIOS10();
  38. _isIOS7Later = [[UIDevice currentDevice].systemVersion doubleValue]>= 8.0;
  39. }
  40. return self;
  41. }
  42. - (BOOL)isPortrait
  43. {
  44. return UIInterfaceOrientationIsPortrait([UIApplication sharedApplication].statusBarOrientation);
  45. }
  46. @end