OliveappDeviceHelper.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. //
  2. // DeviceHelper.h
  3. // YituFaceVerifiactionSDK
  4. //
  5. // Created by Jiteng Hao on 15/9/11.
  6. // Copyright (c) 2015年 YITU. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. @interface OliveappDeviceHelper : NSObject
  10. extern NSString * const IPHONE;
  11. extern NSString * const IPOD;
  12. /**
  13. 用户设置的屏幕方向
  14. - PORTRAIT: 竖屏
  15. - LANDSCAPE_LEFT: 左横屏
  16. - LANDSCAPE_RIGHT: 右横屏
  17. */
  18. typedef NS_ENUM(int,OliveappDeviceOrientation) {
  19. PORTRAIT = 0,
  20. LANDSCAPE_LEFT = 1,
  21. LANDSCAPE_RIGHT = 2
  22. };
  23. + (NSString*) deviceName;
  24. + (NSString*)platformString: (NSString*) platform;
  25. + (BOOL) isiPhone7:(NSString*) platform;
  26. /**
  27. 拿到设备信息
  28. @return 拿到设备信息
  29. */
  30. + (NSDictionary *) getDeviceInfo;
  31. /**
  32. 拿到生产商名称
  33. @return 生产商名
  34. */
  35. + (NSString *) getManufacturer;
  36. /**
  37. 拿到型号
  38. @return 拿到型号
  39. */
  40. + (NSString *) getModel;
  41. /**
  42. 拿到系统名
  43. @return 系统名
  44. */
  45. + (NSString *) getOsname;
  46. /**
  47. 拿到系统版本
  48. @return 系统版本
  49. */
  50. + (NSString *) getOsversion;
  51. /**
  52. 设置屏幕方向接口
  53. @param orientation orientation为用户想要设置的方向
  54. */
  55. + (void) setFixedOrientation:(OliveappDeviceOrientation)orientation;
  56. /**
  57. 获取用户设置的屏幕方向
  58. @return 返回屏幕方向,只有iPad能设置横屏
  59. */
  60. + (OliveappDeviceOrientation)getFixedOrientation;
  61. /**
  62. 设备类型
  63. @return 返回是不是iPad
  64. */
  65. + (BOOL) deviceIsPad;
  66. #define IS_OS_5_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 5.0)
  67. #define IS_OS_6_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 6.0)
  68. #define IS_OS_7_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0)
  69. #define IS_OS_8_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
  70. #define IS_OS_9_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0)
  71. #define IS_OS_10_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 10.0)
  72. @end