forked from InderKumarRathore/DeviceUtil
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeviceUtil.h
More file actions
210 lines (177 loc) · 4.71 KB
/
DeviceUtil.h
File metadata and controls
210 lines (177 loc) · 4.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
//
// DeviceUtil.h
//
// Created by Inder Kumar Rathore on 19/01/13.
// Copyright (c) 2013 Rathore. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSUInteger, Hardware) {
NOT_AVAILABLE,
IPHONE_2G,
IPHONE_3G,
IPHONE_3GS,
IPHONE_4,
IPHONE_4_CDMA,
IPHONE_4S,
IPHONE_5,
IPHONE_5_CDMA_GSM,
IPHONE_5C,
IPHONE_5C_CDMA_GSM,
IPHONE_5S,
IPHONE_5S_CDMA_GSM,
IPHONE_6,
IPHONE_6_PLUS,
IPHONE_6S,
IPHONE_6S_PLUS,
IPHONE_SE,
IPHONE_7,
IPHONE_7_GSM,
IPHONE_7_PLUS,
IPHONE_7_PLUS_GSM,
IPOD_TOUCH_1G,
IPOD_TOUCH_2G,
IPOD_TOUCH_3G,
IPOD_TOUCH_4G,
IPOD_TOUCH_5G,
IPOD_TOUCH_6G,
IPAD,
IPAD_2,
IPAD_2_WIFI,
IPAD_2_CDMA,
IPAD_3,
IPAD_3G,
IPAD_3_WIFI,
IPAD_3_WIFI_CDMA,
IPAD_4,
IPAD_4_WIFI,
IPAD_4_GSM_CDMA,
IPAD_MINI,
IPAD_MINI_WIFI,
IPAD_MINI_WIFI_CDMA,
IPAD_MINI_RETINA_WIFI,
IPAD_MINI_RETINA_WIFI_CDMA,
IPAD_MINI_3_WIFI,
IPAD_MINI_3_WIFI_CELLULAR,
IPAD_MINI_3_WIFI_CELLULAR_CN,
IPAD_MINI_4_WIFI,
IPAD_MINI_4_WIFI_CELLULAR,
IPAD_MINI_RETINA_WIFI_CELLULAR_CN,
IPAD_AIR_WIFI,
IPAD_AIR_WIFI_GSM,
IPAD_AIR_WIFI_CDMA,
IPAD_AIR_2_WIFI,
IPAD_AIR_2_WIFI_CELLULAR,
IPAD_PRO_97_WIFI,
IPAD_PRO_97_WIFI_CELLULAR,
IPAD_PRO_WIFI,
IPAD_PRO_WIFI_CELLULAR,
IPAD_5_WIFI,
IPAD_5_WIFI_CELLULAR,
APPLE_TV_1G,
APPLE_TV_2G,
APPLE_TV_3G,
APPLE_TV_3_2G,
APPLE_TV_4G,
APPLE_WATCH_38,
APPLE_WATCH_42,
APPLE_WATCH_SERIES_2_38,
APPLE_WATCH_SERIES_2_42,
APPLE_WATCH_SERIES_1_38,
APPLE_WATCH_SERIES_1_42,
SIMULATOR,
HARDWARE_MAX
};
/**
* Hardware string of devices
*/
extern NSString* const iPhone1_1;
extern NSString* const iPhone1_2;
extern NSString* const iPhone2_1;
extern NSString* const iPhone3_1;
extern NSString* const iPhone3_2;
extern NSString* const iPhone3_3;
extern NSString* const iPhone4_1;
extern NSString* const iPhone5_1;
extern NSString* const iPhone5_2;
extern NSString* const iPhone5_3;
extern NSString* const iPhone5_4;
extern NSString* const iPhone6_1;
extern NSString* const iPhone6_2;
extern NSString* const iPhone7_1;
extern NSString* const iPhone7_2;
extern NSString* const iPhone8_1;
extern NSString* const iPhone8_2;
extern NSString* const iPhone8_4;
extern NSString* const iPhone9_1;
extern NSString* const iPhone9_2;
extern NSString* const iPhone9_3;
extern NSString* const iPhone9_4;
extern NSString* const iPod1_1;
extern NSString* const iPod2_1;
extern NSString* const iPod3_1;
extern NSString* const iPod4_1;
extern NSString* const iPod5_1;
extern NSString* const iPod7_1;
extern NSString* const iPad1_1;
extern NSString* const iPad1_2;
extern NSString* const iPad2_1;
extern NSString* const iPad2_2;
extern NSString* const iPad2_3;
extern NSString* const iPad2_4;
extern NSString* const iPad2_5;
extern NSString* const iPad2_6;
extern NSString* const iPad2_7;
extern NSString* const iPad3_1;
extern NSString* const iPad3_2;
extern NSString* const iPad3_3;
extern NSString* const iPad3_4;
extern NSString* const iPad3_5;
extern NSString* const iPad3_6;
extern NSString* const iPad4_1;
extern NSString* const iPad4_2;
extern NSString* const iPad4_3;
extern NSString* const iPad4_4;
extern NSString* const iPad4_5;
extern NSString* const iPad4_6;
extern NSString* const iPad4_7;
extern NSString* const iPad4_8;
extern NSString* const iPad4_9;
extern NSString* const iPad5_1;
extern NSString* const iPad5_2;
extern NSString* const iPad5_3;
extern NSString* const iPad5_4;
extern NSString* const iPad6_3;
extern NSString* const iPad6_4;
extern NSString* const iPad6_7;
extern NSString* const iPad6_8;
extern NSString* const iPad6_11;
extern NSString* const iPad6_12;
extern NSString* const AppleTV1_1;
extern NSString* const AppleTV2_1;
extern NSString* const AppleTV3_1;
extern NSString* const AppleTV3_2;
extern NSString* const AppleTV5_3;
extern NSString* const Watch1_1;
extern NSString* const Watch1_2;
extern NSString* const Watch2_3;
extern NSString* const Watch2_4;
extern NSString* const Watch2_6;
extern NSString* const Watch2_7;
extern NSString* const i386_Sim;
extern NSString* const x86_64_Sim;
@interface DeviceUtil : NSObject
/** This method retruns the hardware type */
+ (NSString*)hardwareString;
/** This method returns the Hardware enum depending upon hardware string */
+ (Hardware)hardware;
/** This method returns the readable description of hardware string */
+ (NSString*)hardwareDescription;
/**
This method returns the hardware number not actual but logically.
e.g. if the hardware string is 5,1 then hardware number would be 5.1
*/
+ (float)hardwareNumber;
/** This method returns the resolution for still image that can be received
from back camera of the current device. Resolution returned for image oriented landscape right. **/
+ (CGSize)backCameraStillImageResolutionInPixels;
@end