NIMKitDevice.m 896 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //
  2. // NIMKitDevice.m
  3. // NIM
  4. //
  5. // Created by chris on 15/9/18.
  6. // Copyright © 2015年 Netease. All rights reserved.
  7. //
  8. #import "NIMKitDevice.h"
  9. #import "NIMGlobalMacro.h"
  10. #define NIMKitNormalImageSize (1280 * 960)
  11. @interface NIMKitDevice ()
  12. @end
  13. @implementation NIMKitDevice
  14. - (instancetype)init
  15. {
  16. if (self = [super init])
  17. {
  18. }
  19. return self;
  20. }
  21. + (NIMKitDevice *)currentDevice{
  22. static NIMKitDevice *instance = nil;
  23. static dispatch_once_t onceToken;
  24. dispatch_once(&onceToken, ^{
  25. instance = [[NIMKitDevice alloc] init];
  26. });
  27. return instance;
  28. }
  29. //图片/音频推荐参数
  30. - (CGFloat)suggestImagePixels{
  31. return NIMKitNormalImageSize;
  32. }
  33. - (CGFloat)compressQuality{
  34. return 0.5;
  35. }
  36. - (CGFloat)statusBarHeight{
  37. CGFloat height = [UIApplication sharedApplication].statusBarFrame.size.height;
  38. return height;
  39. }
  40. @end