From 69828e1abf5d5b6d3a181bab57710e17dd916180 Mon Sep 17 00:00:00 2001 From: Helihua Date: Fri, 11 Oct 2013 17:55:51 +0800 Subject: [PATCH] Append new iPhone and iPod device type --- UIDevice-Hardware.h | 4 ++++ UIDevice-Hardware.m | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/UIDevice-Hardware.h b/UIDevice-Hardware.h index 261229b..65d9aa6 100644 --- a/UIDevice-Hardware.h +++ b/UIDevice-Hardware.h @@ -14,12 +14,14 @@ #define IPHONE_4_NAMESTRING @"iPhone 4" #define IPHONE_4S_NAMESTRING @"iPhone 4S" #define IPHONE_5_NAMESTRING @"iPhone 5" +#define IPHONE_5S_NAMESTRING @"iPhone 5S" #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" @@ -54,11 +56,13 @@ typedef enum { UIDevice4iPhone, UIDevice4SiPhone, UIDevice5iPhone, + UIDevice5SiPhone, UIDevice1GiPod, UIDevice2GiPod, UIDevice3GiPod, UIDevice4GiPod, + UIDevice5GiPod, UIDevice1GiPad, UIDevice2GiPad, diff --git a/UIDevice-Hardware.m b/UIDevice-Hardware.m index 07c033f..b43873c 100644 --- a/UIDevice-Hardware.m +++ b/UIDevice-Hardware.m @@ -161,12 +161,14 @@ - (NSUInteger) platformType if ([platform hasPrefix:@"iPhone3"]) return UIDevice4iPhone; if ([platform hasPrefix:@"iPhone4"]) return UIDevice4SiPhone; if ([platform hasPrefix:@"iPhone5"]) return UIDevice5iPhone; + if ([platform hasPrefix:@"iPhone6"]) return UIDevice5SiPhone; // 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; @@ -203,12 +205,14 @@ - (NSString *) platformString case UIDevice4iPhone: return IPHONE_4_NAMESTRING; case UIDevice4SiPhone: return IPHONE_4S_NAMESTRING; case UIDevice5iPhone: return IPHONE_5_NAMESTRING; + case UIDevice5SiPhone: return IPHONE_5S_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;