Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update data according to new devices #28

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions UIDevice-Hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,28 @@
#define IPHONE_4_NAMESTRING @"iPhone 4"
#define IPHONE_4S_NAMESTRING @"iPhone 4S"
#define IPHONE_5_NAMESTRING @"iPhone 5"
#define IPHONE_5C_NAMESTRING @"iPhone 5S"
#define IPHONE_5S_NAMESTRING @"iPhone 5C"
#define IPHONE_6_NAMESTRING @"iPhone 6"
#define IPHONE_6PLUS_NAMESTRING @"iPhone 6 Plus"
#define IPHONE_UNKNOWN_NAMESTRING @"Unknown iPhone"

#define IPOD_1G_NAMESTRING @"iPod touch 1G"
#define IPOD_2G_NAMESTRING @"iPod touch 2G"
#define IPOD_3G_NAMESTRING @"iPod touch 3G"
#define IPOD_4G_NAMESTRING @"iPod touch 4G"
#define IPOD_5G_NAMESTRING @"iPod touch 5G"
#define IPOD_UNKNOWN_NAMESTRING @"Unknown iPod"

#define IPAD_1G_NAMESTRING @"iPad 1G"
#define IPAD_2G_NAMESTRING @"iPad 2G"
#define IPAD_3G_NAMESTRING @"iPad 3G"
#define IPAD_4G_NAMESTRING @"iPad 4G"
#define IPAD_AIR_NAMESTRING @"iPad Air"
#define IPAD_AIR2_NAMESTRING @"iPad Air 2"
#define IPAD_MINI_NAMESTRING @"iPad Mini"
#define IPAD_MINI2_NAMESTRING @"iPad Mini 2"
#define IPAD_MINI3_NAMESTRING @"iPad Mini 3"
#define IPAD_UNKNOWN_NAMESTRING @"Unknown iPad"

#define APPLETV_2G_NAMESTRING @"Apple TV 2G"
Expand Down Expand Up @@ -54,16 +64,26 @@ typedef enum {
UIDevice4iPhone,
UIDevice4SiPhone,
UIDevice5iPhone,
UIDevice5CiPhone,
UIDevice5SiPhone,
UIDevice6iPhone,
UIDevice6PlusiPhone,

UIDevice1GiPod,
UIDevice2GiPod,
UIDevice3GiPod,
UIDevice4GiPod,
UIDevice5GiPod,

UIDevice1GiPad,
UIDevice2GiPad,
UIDevice3GiPad,
UIDevice4GiPad,
UIDeviceiPadAir,
UIDeviceiPadAir2,
UIDeviceiPadMini,
UIDeviceiPadMini2,
UIDeviceiPadMini3,

UIDeviceAppleTV2,
UIDeviceAppleTV3,
Expand Down
34 changes: 30 additions & 4 deletions UIDevice-Hardware.m
Original file line number Diff line number Diff line change
Expand Up @@ -160,19 +160,36 @@ - (NSUInteger) platformType
if ([platform hasPrefix:@"iPhone2"]) return UIDevice3GSiPhone;
if ([platform hasPrefix:@"iPhone3"]) return UIDevice4iPhone;
if ([platform hasPrefix:@"iPhone4"]) return UIDevice4SiPhone;
if ([platform hasPrefix:@"iPhone5"]) return UIDevice5iPhone;
if ([platform hasPrefix:@"iPhone5,1"]) return UIDevice5iPhone;
if ([platform hasPrefix:@"iPhone5,2"]) return UIDevice5iPhone;
if ([platform hasPrefix:@"iPhone5,3"]) return UIDevice5CiPhone;
if ([platform hasPrefix:@"iPhone5,4"]) return UIDevice5CiPhone;
if ([platform hasPrefix:@"iPhone6"]) return UIDevice5SiPhone;
if ([platform hasPrefix:@"iPhone7,1"]) return UIDevice6PlusiPhone;
if ([platform hasPrefix:@"iPhone7,2"]) return UIDevice6iPhone;

// iPod
if ([platform hasPrefix:@"iPod1"]) return UIDevice1GiPod;
if ([platform hasPrefix:@"iPod2"]) return UIDevice2GiPod;
if ([platform hasPrefix:@"iPod3"]) return UIDevice3GiPod;
if ([platform hasPrefix:@"iPod4"]) return UIDevice4GiPod;
if ([platform hasPrefix:@"iPod5"]) return UIDevice5GiPod;

// iPad
if ([platform hasPrefix:@"iPad1"]) return UIDevice1GiPad;
if ([platform hasPrefix:@"iPad2"]) return UIDevice2GiPad;
if ([platform hasPrefix:@"iPad3"]) return UIDevice3GiPad;
if ([platform hasPrefix:@"iPad4"]) return UIDevice4GiPad;
if ([platform hasPrefix:@"iPad3,1"]) return UIDevice3GiPad;
if ([platform hasPrefix:@"iPad3,2"]) return UIDevice3GiPad;
if ([platform hasPrefix:@"iPad3,3"]) return UIDevice3GiPad;
if ([platform hasPrefix:@"iPad3,4"]) return UIDevice4GiPad;
if ([platform hasPrefix:@"iPad3,5"]) return UIDevice4GiPad;
if ([platform hasPrefix:@"iPad3,6"]) return UIDevice4GiPad;
if ([platform hasPrefix:@"iPad4,1"]) return UIDeviceiPadAir;
if ([platform hasPrefix:@"iPad4,2"]) return UIDeviceiPadAir;
if ([platform hasPrefix:@"iPad4,3"]) return UIDeviceiPadAir;
if ([platform hasPrefix:@"iPad4,4"]) return UIDeviceiPadMini2;
if ([platform hasPrefix:@"iPad4,5"]) return UIDeviceiPadMini2;
if ([platform hasPrefix:@"iPad4,6"]) return UIDeviceiPadMini2;

// Apple TV
if ([platform hasPrefix:@"AppleTV2"]) return UIDeviceAppleTV2;
Expand Down Expand Up @@ -203,18 +220,27 @@ - (NSString *) platformString
case UIDevice4iPhone: return IPHONE_4_NAMESTRING;
case UIDevice4SiPhone: return IPHONE_4S_NAMESTRING;
case UIDevice5iPhone: return IPHONE_5_NAMESTRING;
case UIDevice5CiPhone: return IPHONE_5C_NAMESTRING;
case UIDevice5SiPhone: return IPHONE_5S_NAMESTRING;
case UIDevice6iPhone: return IPHONE_6_NAMESTRING;
case UIDevice6PlusiPhone: return IPHONE_6PLUS_NAMESTRING;
case UIDeviceUnknowniPhone: return IPHONE_UNKNOWN_NAMESTRING;

case UIDevice1GiPod: return IPOD_1G_NAMESTRING;
case UIDevice2GiPod: return IPOD_2G_NAMESTRING;
case UIDevice3GiPod: return IPOD_3G_NAMESTRING;
case UIDevice4GiPod: return IPOD_4G_NAMESTRING;
case UIDevice5GiPod: return IPOD_5G_NAMESTRING;
case UIDeviceUnknowniPod: return IPOD_UNKNOWN_NAMESTRING;

case UIDevice1GiPad : return IPAD_1G_NAMESTRING;
case UIDevice2GiPad : return IPAD_2G_NAMESTRING;
case UIDevice3GiPad : return IPAD_3G_NAMESTRING;
case UIDevice4GiPad : return IPAD_4G_NAMESTRING;
case UIDeviceiPadAir : return IPAD_AIR_NAMESTRING;
case UIDeviceiPadAir2 : return IPAD_AIR2_NAMESTRING;
case UIDeviceiPadMini : return IPAD_MINI_NAMESTRING;
case UIDeviceiPadMini2 : return IPAD_MINI2_NAMESTRING;
case UIDeviceiPadMini3 : return IPAD_MINI3_NAMESTRING;
case UIDeviceUnknowniPad : return IPAD_UNKNOWN_NAMESTRING;

case UIDeviceAppleTV2 : return APPLETV_2G_NAMESTRING;
Expand Down