//
//  ModelJudgeFunc.m
//  NineClouds
//
//  Created by xiejiangbo on 2017/11/23.
//  Copyright © 2017年 yin chen. All rights reserved.
//

#import "ModelJudgeFunc.h"
#import <sys/utsname.h>
@implementation ModelJudgeFunc
+(NSString *)deviceModelName{
    struct utsname systemInfor;
    uname(&systemInfor);
    NSString *platform = [NSString stringWithCString:systemInfor.machine encoding:NSUTF8StringEncoding];
//    NSLog(@"%@",platform);
    if ([platform isEqualToString:@"iPhone3,1"]) {return @"iPhone4";}
    if ([platform isEqualToString:@"iPhone3,2"]) {return @"iPhone4";}
    if ([platform isEqualToString:@"iPhone4,1"]) {return @"iPhone4S";}
    if ([platform isEqualToString:@"iPhone5,1"]) {return @"iPhone5";}
    if ([platform isEqualToString:@"iPhone5,2"]) {return @"iPhone5";}
    if ([platform isEqualToString:@"iPhone5,3"]) {return @"iPhone5C";}
    if ([platform isEqualToString:@"iPhone5,4"]) {return @"iPhone5C";}
    if ([platform isEqualToString:@"iPhone6,1"]) {return @"iPhone5S";}
    if ([platform isEqualToString:@"iPhone6,2"]) {return @"iPhone5S";}
    if ([platform isEqualToString:@"iPhone7,1"]) {return @"iPhone6 Plus";}
    if ([platform isEqualToString:@"iPhone7,2"]) {return @"iPhone6";}
    if ([platform isEqualToString:@"iPhone8,1"]) {return @"iPhone6S";}
    if ([platform isEqualToString:@"iPhone8,2"]) {return @"iPhone6S Plus";}
    if ([platform isEqualToString:@"iPhone8,4"]) {return @"iPhoneSE";}
    if ([platform isEqualToString:@"iPhone9,1"]) {return @"iPhone7";}
    if ([platform isEqualToString:@"iPhone9,2"]) {return @"iPhone7";}
    if ([platform isEqualToString:@"iPhone9,3"]) {return @"iPhone7 Plus";}
    if ([platform isEqualToString:@"iPhone9,4"]) {return @"iPhone7 Plus";}
    if ([platform isEqualToString:@"iPhone10,1"]) {return @"iPhone8";}
    if ([platform isEqualToString:@"iPhone10,2"]) {return @"iPhone8";}
    if ([platform isEqualToString:@"iPhone10,4"]) {return @"iPhone8 Plus";}
    if ([platform isEqualToString:@"iPhone10,5"]) {return @"iPhone8 Plus";}
    if ([platform isEqualToString:@"iPhone10,3"]) {return @"iPhone X";}
    if ([platform isEqualToString:@"iPhone10,6"]) {return @"iPhone X";}
    if ([platform isEqualToString:@"iPhone11,8"]) {return @"iPhone XR";}
    if ([platform isEqualToString:@"iPhone11,2"]) {return @"iPhone XS";}
    if ([platform isEqualToString:@"iPhone11,6"]) {return @"iPhone XS Max";}
    if ([platform isEqualToString:@"iPhone11,4"]) {return @"iPhone XS Max";}
    if ([platform isEqualToString:@"iPhone12,1"]) {return @"iPhone 11";}
    if ([platform isEqualToString:@"iPhone12,3"]) {return @"iPhone 11 Pro";}
    if ([platform isEqualToString:@"iPhone12,5"]) {return @"iPhone 11 Pro Max";}
    if ([platform isEqualToString:@"iPhone12,8"]) {return @"iPhonSE 2";}
    if ([platform isEqualToString:@"iPhone13,1"]) {return @"iPhone 12 mini";}
    if ([platform isEqualToString:@"iPhone13,2"]) {return @"iPhone 12";}
    if ([platform isEqualToString:@"iPhone13,3"]) {return @"iPhone 12 Pro";}
    if ([platform isEqualToString:@"iPhone13,4"]) {return @"iPhone 12 Pro Max";}
    if ([platform isEqualToString:@"iPhone14,4"]) {return @"iPhone 13 mini";}
    if ([platform isEqualToString:@"iPhone14,5"]) {return @"iPhone 13";}
    if ([platform isEqualToString:@"iPhone14,2"]) {return @"iPhone 13 Pro";}
    if ([platform isEqualToString:@"iPhone14,3"]) {return @"iPhone 13 Pro Max";}
    if ([platform isEqualToString:@"iPhone14,7"]) {return @"iPhone 14";}
    if ([platform isEqualToString:@"iPhone14,8"]) {return @"iPhone 14 Plus";}
    if ([platform isEqualToString:@"iPhone15,2"]) {return @"iPhone14 Pro";}
    if ([platform isEqualToString:@"iPhone15,3"]) {return @"iPhone14 Pro Max";}
    if ([platform isEqualToString:@"iPhone15,4"]) {return @"iPhone15";}
    if ([platform isEqualToString:@"iPhone15,5"]) {return @"iPhone15 Plus";}
    if ([platform isEqualToString:@"iPhone16,1"]) {return @"iPhone15 Pro";}
    if ([platform isEqualToString:@"iPhone16,2"]) {return @"iPhone15 Pro Max";}
    return platform;
}
@end













