forked from erichoracek/UIDevice-Hardware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUIDevice-Hardware.h
41 lines (32 loc) · 940 Bytes
/
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
/*
Erica Sadun, http://ericasadun.com
iPhone Developer's Cookbook, 6.x Edition
BSD License, Use at your own risk
Modified by Eric Horacek for Monospace Ltd. on 2/4/13
*/
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSUInteger, UIDeviceFamily) {
UIDeviceFamilyiPhone,
UIDeviceFamilyiPod,
UIDeviceFamilyiPad,
UIDeviceFamilyAppleTV,
UIDeviceFamilyUnknown,
};
@interface UIDevice (Hardware)
/**
Returns a machine-readable model name in the format of "iPhone4,1"
*/
- (NSString *)modelIdentifier;
/**
Returns a human-readable model name in the format of "iPhone 4S". Fallback of the the `modelIdentifier` value.
*/
- (NSString *)modelName;
/**
Returns a human-readable model name grouped by generation in the format of "iPhone 4S". Fallback of the the `modelIdentifier` value.
*/
- (NSString *)generationModelName;
/**
Returns the device family as a `UIDeviceFamily`
*/
- (UIDeviceFamily)deviceFamily;
@end