Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
UIDeviceHardware - Determine iOS device being used
//
// UIDeviceHardware.h
//
// Used to determine EXACT version of device software is running on.
#import <Foundation/Foundation.h>
@interface UIDeviceHardware : NSObject
- (NSString *) platform;
- (NSString *) platformString;
@end
//
// UIDeviceHardware.m
//
// Used to determine EXACT version of device software is running on.
#import "UIDeviceHardware.h"
#include <sys/types.h>
#include <sys/sysctl.h>
@implementation UIDeviceHardware
- (NSString *) platform{
size_t size;
sysctlbyname("hw.machine", NULL, &size, NULL, 0);
char *machine = malloc(size);
sysctlbyname("hw.machine", machine, &size, NULL, 0);
NSString *platform = [NSString stringWithUTF8String:machine];
free(machine);
return platform;
}
- (NSString *) platformString{
NSString *platform = [self platform];
if ([platform isEqualToString:@"iPhone1,1"]) return @"iPhone 1G";
if ([platform isEqualToString:@"iPhone1,2"]) return @"iPhone 3G";
if ([platform isEqualToString:@"iPhone2,1"]) return @"iPhone 3GS";
if ([platform isEqualToString:@"iPhone3,1"]) return @"iPhone 4";
if ([platform isEqualToString:@"iPhone3,3"]) return @"Verizon iPhone 4";
if ([platform isEqualToString:@"iPhone4,1"]) return @"iPhone 4S";
if ([platform isEqualToString:@"iPod1,1"]) return @"iPod Touch 1G";
if ([platform isEqualToString:@"iPod2,1"]) return @"iPod Touch 2G";
if ([platform isEqualToString:@"iPod3,1"]) return @"iPod Touch 3G";
if ([platform isEqualToString:@"iPod4,1"]) return @"iPod Touch 4G";
if ([platform isEqualToString:@"iPad1,1"]) return @"iPad";
if ([platform isEqualToString:@"iPad2,1"]) return @"iPad 2 (WiFi)";
if ([platform isEqualToString:@"iPad2,2"]) return @"iPad 2 (GSM)";
if ([platform isEqualToString:@"iPad2,3"]) return @"iPad 2 (CDMA)";
if ([platform isEqualToString:@"i386"]) return @"Simulator";
if ([platform isEqualToString:@"x86_64"]) return @"Simulator";
return platform;
}
@end
UIDeviceHardware *h=[[UIDeviceHardware alloc] init];
[self setDeviceModel:[h platformString]];
[h release];
@Ricardo1980

Thanks for the code.
I think class methods are better, to avoid class instantiation:

  • (NSString *) platform;
  • (NSString *) platformString;

And change:
NSString *platform = [self platform];
by
NSString *platform = [UIDeviceHardware platform];

Now usage is easier and more elegant

@Jaybles
Owner
@Ricardo1980
@danielphillips

It seems to me this may be accessing private data of the phone - meaning non public framework apis. Has anyone got this into the app store ?

@Ricardo1980

Which one?

@tybro0103

I also would like to know if anyone has gotten their app approved using this code?

@jagill

I've had several apps accepted to the app store using this (or similar) code.

@OlofT

Have anyone plattformStrings of iPhone 5?

Aso, if anyone still wonders, all of this code uses public API. Personal data != private API.

@jeevanantham

hi is there any way to find 5.1 from the platfrom string....

@besi

Can you add iPhone 5 and the new iPod touch?

@DjinnGA

iPhone 5 is

if ([platform isEqualToString:@"iPhone5,2"])    return @"iPhone 5";

@suda

The new iPad:

if ([platform isEqualToString:@"iPad3,1"])      return @"iPad 3 (WiFi)";
if ([platform isEqualToString:@"iPad3,2"])      return @"iPad 3 (GSM)";
if ([platform isEqualToString:@"iPad3,3"])      return @"iPad 3 (CDMA)";
@eloehfelm

iPad Mini is:

if ([platform isEqualToString:@"iPad2,5"]) return @"iPad mini";

@GammaDraconis

iPod 5th gen
if ([platform isEqualToString:@"iPod5,1"]) return @"iPod Touch 5G";

if ([platform isEqualToString:@"iPad3,4"]) return @"iPad 4 (WiFi)";
I don't have a cell-enabled one to tell you if those return anything different. Perhaps ,5 and ,6?

@jeremieweldin
if ([platform isEqualToString:@"iPhone1,1"])    return @"iPhone 1G";
if ([platform isEqualToString:@"iPhone1,2"])    return @"iPhone 3G";
if ([platform isEqualToString:@"iPhone2,1"])    return @"iPhone 3GS";
if ([platform isEqualToString:@"iPhone3,1"])    return @"iPhone 4";
if ([platform isEqualToString:@"iPhone3,3"])    return @"Verizon iPhone 4";
if ([platform isEqualToString:@"iPhone4,1"])    return @"iPhone 4S";
if ([platform isEqualToString:@"iPhone5,1"])    return @"iPhone 5 (GSM)";
if ([platform isEqualToString:@"iPhone5,2"])    return @"iPhone 5 (GSM+CDMA)";
if ([platform isEqualToString:@"iPod1,1"])      return @"iPod Touch 1G";
if ([platform isEqualToString:@"iPod2,1"])      return @"iPod Touch 2G";
if ([platform isEqualToString:@"iPod3,1"])      return @"iPod Touch 3G";
if ([platform isEqualToString:@"iPod4,1"])      return @"iPod Touch 4G";
if ([platform isEqualToString:@"iPod5,1"])      return @"iPod Touch 5G";
if ([platform isEqualToString:@"iPad1,1"])      return @"iPad";
if ([platform isEqualToString:@"iPad2,1"])      return @"iPad 2 (WiFi)";
if ([platform isEqualToString:@"iPad2,2"])      return @"iPad 2 (GSM)";
if ([platform isEqualToString:@"iPad2,3"])      return @"iPad 2 (CDMA)";
if ([platform isEqualToString:@"iPad2,4"])      return @"iPad 2 (WiFi)";
if ([platform isEqualToString:@"iPad2,5"])      return @"iPad Mini (WiFi)";
if ([platform isEqualToString:@"iPad2,6"])      return @"iPad Mini (GSM)";
if ([platform isEqualToString:@"iPad2,7"])      return @"iPad Mini (GSM+CDMA)";
if ([platform isEqualToString:@"iPad3,1"])      return @"iPad 3 (WiFi)";
if ([platform isEqualToString:@"iPad3,2"])      return @"iPad 3 (GSM+CDMA)";
if ([platform isEqualToString:@"iPad3,3"])      return @"iPad 3 (GSM)";
if ([platform isEqualToString:@"iPad3,4"])      return @"iPad 4 (WiFi)";
if ([platform isEqualToString:@"iPad3,5"])      return @"iPad 4 (GSM)";
if ([platform isEqualToString:@"iPad3,6"])      return @"iPad 4 (GSM+CDMA)";
if ([platform isEqualToString:@"i386"])         return @"Simulator";
if ([platform isEqualToString:@"x86_64"])       return @"Simulator";

Using: http://theiphonewiki.com/wiki/Models as a guide.

@clivesstuff

hi
Can someone clarify how i can use this above code.
I am still learning xcode quickly but this confuses me as i dont know where to put it.
I dont get any errors i have just tried using NSLOG to tell me what platform is connected but it doesnt work as i cannot call the NSString platform.
I basicallt want to set variables so my program knows what device is connected.
Any help would be great
thanks
clive

@mattdipasquale

Two enhancements.

  1. According to the Mac OS X Manual Page For sysctl(3), "the sysctl() function runs in about a third the time as the same request made via the sysctlbyname() function." So, the following code is probably a bit faster because it uses sysctl() instead of sysctlbyname(), but I didn't test it.

    #include <sys/sysctl.h>
    
    NSString *AACPlatform()
    {
        int mib[] = {CTL_HW, HW_MACHINE};
        size_t len = 0;
        sysctl(mib, 2, NULL, &len, NULL, 0);
        char *machine = malloc(len);
        sysctl(mib, 2, machine, &len, NULL, 0);
        NSString *platform = [NSString stringWithCString:machine encoding:NSASCIIStringEncoding];
        free(machine);
        return platform;
    }
    
  2. You can make both Objective-C methods C functions since they don't access any instance variables.

@marjinn

I also see that the freebsd implementation of sysctlbyname uses syctl and sysctltomib.
(http://fxr.watson.org/fxr/source/gen/sysctlbyname.c?v=FREEBSD-LIBC).
Is Apple's implementation any different?

@moleksyuk

Any updates for iPhone 5S & 5C?

@mintakson

iPhone 5c : @"iPhone5,3" @"iPhone5,4"
iPhone 5s : @"iPhone6,1" @"iPhone6,2"

Reference is http://theiphonewiki.com/wiki/Models

@fahrulazmi

Addition for iPad Air and iPad Mini Retina

if ([platform isEqualToString:@"iPad4,1"])      return @"iPad Air (WiFi)";
if ([platform isEqualToString:@"iPad4,2"])      return @"iPad Air (CDMA)";
if ([platform isEqualToString:@"iPad4,4"])      return @"iPad Mini Retina (WiFi)";
if ([platform isEqualToString:@"iPad4,4"])      return @"iPad Mini Retina (CDMA)";
@DeanBilotti

froztbytes, did you mean iPad4,5 for "iPad Mini Retina (CDMA)" ?

@auptown

Or maybe iPad4,3 for "iPad Mini Retina (WiFi)"

@respectTheCode

Updated list with iPhone 5c, 5s, iPad Air and Mini Retina

    if ([platform isEqualToString:@"iPhone1,1"])    return @"iPhone 1G";
    if ([platform isEqualToString:@"iPhone1,2"])    return @"iPhone 3G";
    if ([platform isEqualToString:@"iPhone2,1"])    return @"iPhone 3GS";
    if ([platform isEqualToString:@"iPhone3,1"])    return @"iPhone 4";
    if ([platform isEqualToString:@"iPhone3,3"])    return @"Verizon iPhone 4";
    if ([platform isEqualToString:@"iPhone4,1"])    return @"iPhone 4S";
    if ([platform isEqualToString:@"iPhone5,1"])    return @"iPhone 5 (GSM)";
    if ([platform isEqualToString:@"iPhone5,2"])    return @"iPhone 5 (GSM+CDMA)";
    if ([platform isEqualToString:@"iPhone5,3"])    return @"iPhone 5c (GSM)";
    if ([platform isEqualToString:@"iPhone5,4"])    return @"iPhone 5c (Global)";
    if ([platform isEqualToString:@"iPhone6,1"])    return @"iPhone 5s (GSM)";
    if ([platform isEqualToString:@"iPhone6,2"])    return @"iPhone 5s (Global)";
    if ([platform isEqualToString:@"iPod1,1"])      return @"iPod Touch 1G";
    if ([platform isEqualToString:@"iPod2,1"])      return @"iPod Touch 2G";
    if ([platform isEqualToString:@"iPod3,1"])      return @"iPod Touch 3G";
    if ([platform isEqualToString:@"iPod4,1"])      return @"iPod Touch 4G";
    if ([platform isEqualToString:@"iPod5,1"])      return @"iPod Touch 5G";
    if ([platform isEqualToString:@"iPad1,1"])      return @"iPad";
    if ([platform isEqualToString:@"iPad2,1"])      return @"iPad 2 (WiFi)";
    if ([platform isEqualToString:@"iPad2,2"])      return @"iPad 2 (GSM)";
    if ([platform isEqualToString:@"iPad2,3"])      return @"iPad 2 (CDMA)";
    if ([platform isEqualToString:@"iPad2,4"])      return @"iPad 2 (WiFi)";
    if ([platform isEqualToString:@"iPad2,5"])      return @"iPad Mini (WiFi)";
    if ([platform isEqualToString:@"iPad2,6"])      return @"iPad Mini (GSM)";
    if ([platform isEqualToString:@"iPad2,7"])      return @"iPad Mini (GSM+CDMA)";
    if ([platform isEqualToString:@"iPad3,1"])      return @"iPad 3 (WiFi)";
    if ([platform isEqualToString:@"iPad3,2"])      return @"iPad 3 (GSM+CDMA)";
    if ([platform isEqualToString:@"iPad3,3"])      return @"iPad 3 (GSM)";
    if ([platform isEqualToString:@"iPad3,4"])      return @"iPad 4 (WiFi)";
    if ([platform isEqualToString:@"iPad3,5"])      return @"iPad 4 (GSM)";
    if ([platform isEqualToString:@"iPad3,6"])      return @"iPad 4 (GSM+CDMA)";
    if ([platform isEqualToString:@"iPad4,1"])      return @"iPad Air (WiFi)";
    if ([platform isEqualToString:@"iPad4,2"])      return @"iPad Air (GSM)";
    if ([platform isEqualToString:@"iPad4,4"])      return @"iPad Mini Retina (WiFi)";
    if ([platform isEqualToString:@"iPad4,5"])      return @"iPad Mini Retina (GSM)";
    if ([platform isEqualToString:@"i386"])         return @"Simulator";
    if ([platform isEqualToString:@"x86_64"])       return @"Simulator";
@esasse

I get a warning: "Implicit declaration of function 'sysctlbyname' is invalid in C99" on the line

sysctlbyname("hw.machine", NULL, &size, NULL, 0);
@taiyoOzora

Hi i got an error message for this line

sysctlbyname("hw.machine", NULL, &size, NULL, 0);

Implicit declaration of function 'sysctlbyname' is invalid in C99

I am currently building for iOS7 devices only and using the latest ver of xcode 5 that is on the app store

@gonch

Make sure you import the libraries:

#include <sys/types.h>
#include <sys/sysctl.h>
@revolc

This is great!

@xomodigital-alex

Jay - great code. It currently lacks a license and thus is technically protected and not something we can use in our code. Would you mind choosing a license? Most common licenses for these snippets and free code are MIT and BSD-type licenses which don't restrict usage.

I've attached a sample license you can reuse if that is your wish. You can add it in the header of your .h file or as a separate LICENSE.TXT file in the repo.

Copyright (c) 2010-2014 Your Name

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

@knitish90

please can u help me that how to check this all ipad version in simulatore means without using physical devices..........

@phaitour

Updated list with iPhone 6/6+, and more iPad Airs and iPad Mini 2Gs:

if ([platform isEqualToString:@"iPhone1,1"])    return @"iPhone 1G";
if ([platform isEqualToString:@"iPhone1,2"])    return @"iPhone 3G";
if ([platform isEqualToString:@"iPhone2,1"])    return @"iPhone 3GS";
if ([platform isEqualToString:@"iPhone3,1"])    return @"iPhone 4";
if ([platform isEqualToString:@"iPhone3,2"])    return @"iPhone 4";
if ([platform isEqualToString:@"iPhone3,3"])    return @"Verizon iPhone 4";
if ([platform isEqualToString:@"iPhone4,1"])    return @"iPhone 4S";
if ([platform isEqualToString:@"iPhone5,1"])    return @"iPhone 5 (GSM)";
if ([platform isEqualToString:@"iPhone5,2"])    return @"iPhone 5 (GSM+CDMA)";
if ([platform isEqualToString:@"iPhone5,3"])    return @"iPhone 5C (GSM)";
if ([platform isEqualToString:@"iPhone5,4"])    return @"iPhone 5C (GSM+CDMA)";
if ([platform isEqualToString:@"iPhone6,1"])    return @"iPhone 5S (GSM)";
if ([platform isEqualToString:@"iPhone6,2"])    return @"iPhone 5S (GSM+CDMA)";
if ([platform isEqualToString:@"iPhone7,1"])    return @"iPhone 6+";
if ([platform isEqualToString:@"iPhone7,2"])    return @"iPhone 6";

if ([platform isEqualToString:@"iPod1,1"])      return @"iPod Touch 1G";
if ([platform isEqualToString:@"iPod2,1"])      return @"iPod Touch 2G";
if ([platform isEqualToString:@"iPod3,1"])      return @"iPod Touch 3G";
if ([platform isEqualToString:@"iPod4,1"])      return @"iPod Touch 4G";
if ([platform isEqualToString:@"iPod5,1"])      return @"iPod Touch 5G";

if ([platform isEqualToString:@"iPad1,1"])      return @"iPad";
if ([platform isEqualToString:@"iPad2,1"])      return @"iPad 2 (WiFi)";
if ([platform isEqualToString:@"iPad2,2"])      return @"iPad 2 (GSM)";
if ([platform isEqualToString:@"iPad2,3"])      return @"iPad 2 (CDMA)";
if ([platform isEqualToString:@"iPad2,4"])      return @"iPad 2 (WiFi)";
if ([platform isEqualToString:@"iPad2,5"])      return @"iPad Mini (WiFi)";
if ([platform isEqualToString:@"iPad2,6"])      return @"iPad Mini (GSM)";
if ([platform isEqualToString:@"iPad2,7"])      return @"iPad Mini (GSM+CDMA)";
if ([platform isEqualToString:@"iPad3,1"])      return @"iPad 3 (WiFi)";
if ([platform isEqualToString:@"iPad3,2"])      return @"iPad 3 (GSM+CDMA)";
if ([platform isEqualToString:@"iPad3,3"])      return @"iPad 3 (GSM)";
if ([platform isEqualToString:@"iPad3,4"])      return @"iPad 4 (WiFi)";
if ([platform isEqualToString:@"iPad3,5"])      return @"iPad 4 (GSM)";
if ([platform isEqualToString:@"iPad3,6"])      return @"iPad 4 (GSM+CDMA)";
if ([platform isEqualToString:@"iPad4,1"])      return @"iPad Air (WiFi)";
if ([platform isEqualToString:@"iPad4,2"])      return @"iPad Air (Cellular)";
if ([platform isEqualToString:@"iPad4,3"])      return @"iPad Air";
if ([platform isEqualToString:@"iPad4,4"])      return @"iPad Mini 2G (WiFi)";
if ([platform isEqualToString:@"iPad4,5"])      return @"iPad Mini 2G (Cellular)";
if ([platform isEqualToString:@"iPad4,6"])      return @"iPad Mini 2G";

if ([platform isEqualToString:@"i386"])         return @"Simulator";
if ([platform isEqualToString:@"x86_64"])       return @"Simulator";
@rish2cool

Are you 100% sure this is correct?

if ([platform isEqualToString:@"iPhone7,1"]) return @"iPhone 6+";
if ([platform isEqualToString:@"iPhone7,2"]) return @"iPhone 6";

Going by the trend for iPhone5,5s, it should have been:

if ([platform isEqualToString:@"iPhone7,1"]) return @"iPhone 6 GSM";
if ([platform isEqualToString:@"iPhone7,2"]) return @"iPhone 6 GSM+CDMA";

if ([platform isEqualToString:@"iPhone8,1"]) return @"iPhone 6+ GSM";
if ([platform isEqualToString:@"iPhone8,2"]) return @"iPhone 6+ Global";

@nullproduction

thank you

@goppinath

Thanks guys really a nice job...

@Deanzhao

Cool,Thanks

@ianhead88

what's the authoritative source for the model id? i see everymac.com has the model id, but do not see anything published by apple. has anyone seen anything from apple? is there a way to know without physically checking the devices?

@EvgenyKarkan

Hey everybody!
Can I ship this code to production build?
Will Apple approve my binary?

@zinne

Hi EvgenyKarkan,
I've allready released two games with this code. No problems with the approval.

@zinne

I've done a little extension to do a numeric comparison for forthcoming devices. So for doing this check due to performance issues you can use this like "iPad Air" and later:

+ (int) deviceVersion:(NSString*) deviveType {

    NSString *platform = [self platform];
    int deviceVersion;

    if ([platform containsString:deviveType]) {
        NSString *platformSplit = [platform componentsSeparatedByString:@","][0];
        deviceVersion = [[platformSplit substringFromIndex: [platformSplit length] - 1] intValue];
    } 
    return deviceVersion;
}

so you can use it like this for example:

    int iPadVersion = [UIDeviceHardware deviceVersion:@"iPad"];
    int iPhoneVersion = [UIDeviceHardware deviceVersion:@"iPhone"];

    //iPad Air 2 and all upcoming devices in the future
    if (iPadVersion >= 5) {
        return true;
    }

    //iPhone 6 and all upcoming devices in the future 
    if (iPhoneVersion >= 7) {
        return true;
    }
@yosizo

Are you 100% sure this is correct?
if ([platform isEqualToString:@"iPhone7,1"]) return @"iPhone 6+";
if ([platform isEqualToString:@"iPhone7,2"]) return @"iPhone 6";

that is correct.
It was actually confirmed.

Going by the trend for iPhone5,5s, it should have been:
if ([platform isEqualToString:@"iPhone7,1"]) return @"iPhone 6 GSM";
if ([platform isEqualToString:@"iPhone7,2"]) return @"iPhone 6 GSM+CDMA";
if ([platform isEqualToString:@"iPhone8,1"]) return @"iPhone 6+ GSM";
if ([platform isEqualToString:@"iPhone8,2"]) return @"iPhone 6+ Global";

here is incorrect.

@respectTheCode

Here is the updated list with the iPad Air 2 and iPad Mini 3

    if ([platform isEqualToString:@"iPhone1,1"])    return @"iPhone 1G";
    if ([platform isEqualToString:@"iPhone1,2"])    return @"iPhone 3G";
    if ([platform isEqualToString:@"iPhone2,1"])    return @"iPhone 3GS";
    if ([platform isEqualToString:@"iPhone3,1"])    return @"iPhone 4";
    if ([platform isEqualToString:@"iPhone3,3"])    return @"Verizon iPhone 4";
    if ([platform isEqualToString:@"iPhone4,1"])    return @"iPhone 4S";
    if ([platform isEqualToString:@"iPhone5,1"])    return @"iPhone 5 (GSM)";
    if ([platform isEqualToString:@"iPhone5,2"])    return @"iPhone 5 (GSM+CDMA)";
    if ([platform isEqualToString:@"iPhone5,3"])    return @"iPhone 5c (GSM)";
    if ([platform isEqualToString:@"iPhone5,4"])    return @"iPhone 5c (Global)";
    if ([platform isEqualToString:@"iPhone6,1"])    return @"iPhone 5s (GSM)";
    if ([platform isEqualToString:@"iPhone6,2"])    return @"iPhone 5s (Global)";
    if ([platform isEqualToString:@"iPhone7,1"])    return @"iPhone 6+";
    if ([platform isEqualToString:@"iPhone7,2"])    return @"iPhone 6";

    if ([platform isEqualToString:@"iPod1,1"])      return @"iPod Touch 1G";
    if ([platform isEqualToString:@"iPod2,1"])      return @"iPod Touch 2G";
    if ([platform isEqualToString:@"iPod3,1"])      return @"iPod Touch 3G";
    if ([platform isEqualToString:@"iPod4,1"])      return @"iPod Touch 4G";
    if ([platform isEqualToString:@"iPod5,1"])      return @"iPod Touch 5G";

    if ([platform isEqualToString:@"iPad1,1"])      return @"iPad";
    if ([platform isEqualToString:@"iPad2,1"])      return @"iPad 2 (WiFi)";
    if ([platform isEqualToString:@"iPad2,2"])      return @"iPad 2 (GSM)";
    if ([platform isEqualToString:@"iPad2,3"])      return @"iPad 2 (CDMA)";
    if ([platform isEqualToString:@"iPad2,4"])      return @"iPad 2 (WiFi)";
    if ([platform isEqualToString:@"iPad2,5"])      return @"iPad Mini (WiFi)";
    if ([platform isEqualToString:@"iPad2,6"])      return @"iPad Mini (GSM)";
    if ([platform isEqualToString:@"iPad2,7"])      return @"iPad Mini (GSM+CDMA)";
    if ([platform isEqualToString:@"iPad3,1"])      return @"iPad 3 (WiFi)";
    if ([platform isEqualToString:@"iPad3,2"])      return @"iPad 3 (GSM+CDMA)";
    if ([platform isEqualToString:@"iPad3,3"])      return @"iPad 3 (GSM)";
    if ([platform isEqualToString:@"iPad3,4"])      return @"iPad 4 (WiFi)";
    if ([platform isEqualToString:@"iPad3,5"])      return @"iPad 4 (GSM)";
    if ([platform isEqualToString:@"iPad3,6"])      return @"iPad 4 (GSM+CDMA)";
    if ([platform isEqualToString:@"iPad4,1"])      return @"iPad Air (WiFi)";
    if ([platform isEqualToString:@"iPad4,2"])      return @"iPad Air (Cellular)";
    if ([platform isEqualToString:@"iPad4,3"])      return @"iPad Air";
    if ([platform isEqualToString:@"iPad4,4"])      return @"iPad Mini 2 (WiFi)";
    if ([platform isEqualToString:@"iPad4,5"])      return @"iPad Mini 2 (Cellular)";
    if ([platform isEqualToString:@"iPad4,6"])      return @"iPad Mini 2 (Rev)";
    if ([platform isEqualToString:@"iPad4,7"])      return @"iPad Mini 3 (WiFi)";
    if ([platform isEqualToString:@"iPad4,8"])      return @"iPad Mini 3 (A1600)";
    if ([platform isEqualToString:@"iPad4,9"])      return @"iPad Mini 3 (A1601)";
    if ([platform isEqualToString:@"iPad5,3"])      return @"iPad Air 2 (WiFi)";
    if ([platform isEqualToString:@"iPad5,4"])      return @"iPad Air 2 (Cellular)";

    if ([platform isEqualToString:@"i386"])         return @"Simulator";
    if ([platform isEqualToString:@"x86_64"])       return @"Simulator";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.