forked from erica/uidevice-extension
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathUIDevice-Hardware.h
118 lines (102 loc) · 3.43 KB
/
UIDevice-Hardware.h
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
/*
Erica Sadun, http://ericasadun.com
iPhone Developer's Cookbook, 3.0 Edition
BSD License, Use at your own risk
*/
#import <UIKit/UIKit.h>
#define IFPGA_NAMESTRING @"iFPGA"
#define IPHONE_1G_NAMESTRING @"iPhone 1G"
#define IPHONE_3G_NAMESTRING @"iPhone 3G"
#define IPHONE_3GS_NAMESTRING @"iPhone 3GS"
#define IPHONE_4G_NAMESTRING @"iPhone 4G"
#define IPHONE_UNKNOWN_NAMESTRING @"Unknown iPhone"
#define IPOD_1G_NAMESTRING @"iPod touch 1G"
#define IPOD_2G_NAMESTRING @"iPod touch 2G"
#define IPOD_2GPLUS_NAMESTRING @"iPod touch 2G Plus"
#define IPOD_3G_NAMESTRING @"iPod touch 3G"
#define IPOD_4G_NAMESTRING @"iPod touch 4G"
#define IPOD_UNKNOWN_NAMESTRING @"Unknown iPod"
#define IPAD_1G_NAMESTRING @"iPad 1G"
#define IPAD3G_1G_NAMESTRING @"iPad3G 1G"
#define IPOD_FAMILY_UNKNOWN_DEVICE @"Unknown device in the iPhone/iPod family"
#define IPHONE_SIMULATOR_NAMESTRING @"iPhone Simulator"
#define IPHONE_SIMULATOR_IPHONE_NAMESTRING @"iPhone Simulator"
#define IPHONE_SIMULATOR_IPAD_NAMESTRING @"iPad Simulator"
typedef enum {
UIDeviceUnknown,
UIDeviceiPhoneSimulator,
UIDeviceiPhoneSimulatoriPhone,
UIDeviceiPhoneSimulatoriPad,
UIDevice1GiPhone,
UIDevice3GiPhone,
UIDevice3GSiPhone,
UIDevice4GiPhone,
UIDevice1GiPod,
UIDevice2GiPod,
UIDevice2GPlusiPod,
UIDevice3GiPod,
UIDevice4GiPod,
UIDevice1GiPad,
UIDevice1GiPad3G,
UIDeviceUnknowniPhone,
UIDeviceUnknowniPod,
UIDeviceIFPGA,
} UIDevicePlatform;
typedef enum {
UIDeviceFirmware2,
UIDeviceFirmware3,
UIDeviceFirmware4,
} UIDeviceFirmware;
enum {
UIDeviceSupportsTelephony = 1 << 0,
UIDeviceSupportsSMS = 1 << 1,
UIDeviceSupportsStillCamera = 1 << 2,
UIDeviceSupportsAutofocusCamera = 1 << 3,
UIDeviceSupportsVideoCamera = 1 << 4,
UIDeviceSupportsWifi = 1 << 5,
UIDeviceSupportsAccelerometer = 1 << 6,
UIDeviceSupportsLocationServices = 1 << 7,
UIDeviceSupportsGPS = 1 << 8,
UIDeviceSupportsMagnetometer = 1 << 9,
UIDeviceSupportsBuiltInMicrophone = 1 << 10,
UIDeviceSupportsExternalMicrophone = 1 << 11,
UIDeviceSupportsOPENGLES1_1 = 1 << 12,
UIDeviceSupportsOPENGLES2 = 1 << 13,
UIDeviceSupportsBuiltInSpeaker = 1 << 14,
UIDeviceSupportsVibration = 1 << 15,
UIDeviceSupportsBuiltInProximitySensor = 1 << 16,
UIDeviceSupportsAccessibility = 1 << 17,
UIDeviceSupportsVoiceOver = 1 << 18,
UIDeviceSupportsVoiceControl = 1 << 19,
UIDeviceSupportsBrightnessSensor = 1 << 20,
UIDeviceSupportsPeerToPeer = 1 << 21,
UIDeviceSupportsARMV7 = 1 << 22,
UIDeviceSupportsEncodeAAC = 1 << 23,
UIDeviceSupportsBluetooth = 1 << 24,
UIDeviceSupportsNike = 1 << 25,
UIDeviceSupportsPiezoClicker = 1 << 26,
UIDeviceSupportsVolumeButtons = 1 << 27,
UIDeviceSupportsEnhancedMultitouch = 1 << 28, // http://www.boygeniusreport.com/2010/01/13/apples-tablet-is-an-iphone-on-steroids/
};
/*
NOT Covered:
launch-applications-while-animating, load-thumbnails-while-scrolling,
delay-sleep-for-headset-click, Unified iPod, standalone contacts,
fcc-logos-via-software, gas-gauge-battery & hiccough-interval
*/
@interface UIDevice (Hardware)
- (NSString *) platform;
- (NSUInteger) platformType;
- (NSUInteger) platformCapabilities;
- (NSString *) platformString;
- (NSString *) platformCode;
- (NSArray *) capabilityArray;
- (BOOL) platformHasCapability:(NSUInteger)capability;
- (NSUInteger) cpuFrequency;
- (NSUInteger) busFrequency;
- (NSUInteger) totalMemory;
- (NSUInteger) userMemory;
- (NSNumber *) totalDiskSpace;
- (NSNumber *) freeDiskSpace;
- (NSString *) macaddress;
@end