美文网首页
根据iOS设备型号判断设备

根据iOS设备型号判断设备

作者: 海带先生1 | 来源:发表于2020-04-15 15:12 被阅读0次

    若时间超过2019年新版本设备发布时间,请根据https://www.theiphonewiki.com/wiki/Models,自行添加。

    - (NSString*)currentModel:(NSString*)phoneModel {

        if([phoneModelisEqualToString:@"iPhone3,1"] ||

            [phoneModelisEqualToString:@"iPhone3,2"] ||

            [phoneModelisEqualToString:@"iPhone3,3"])return@"iPhone 4";

        if ([phoneModel isEqualToString:@"iPhone4,1"]) return @"iPhone 4S";

        if([phoneModelisEqualToString:@"iPhone5,1"] ||

            [phoneModelisEqualToString:@"iPhone5,2"])return@"iPhone 5";

        if([phoneModelisEqualToString:@"iPhone5,3"] ||

            [phoneModelisEqualToString:@"iPhone5,4"])return@"iPhone 5C";

        if([phoneModelisEqualToString:@"iPhone6,1"] ||

            [phoneModelisEqualToString:@"iPhone6,2"] ||

            [phoneModelisEqualToString:@"iPhone6,3"])return@"iPhone 5S";

        if ([phoneModel isEqualToString:@"iPhone7,1"]) return @"iPhone 6 Plus";

        if([phoneModelisEqualToString:@"iPhone7,2"])return@"iPhone 6";

        if ([phoneModel isEqualToString:@"iPhone8,1"]) return @"iPhone 6s";

        if ([phoneModel isEqualToString:@"iPhone8,2"]) return @"iPhone 6s Plus";

        if ([phoneModel isEqualToString:@"iPhone8,4"]) return @"iPhone SE";

        if([phoneModelisEqualToString:@"iPhone9,1"] ||

            [phoneModelisEqualToString:@"iPhone9,2"] ||

            [phoneModelisEqualToString:@"iPhone9,3"])return@"iPhone 7";

        if([phoneModelisEqualToString:@"iPhone9,4"] ||

            [phoneModelisEqualToString:@"iPhone9,5"] ||

            [phoneModelisEqualToString:@"iPhone9,6"]) return @"iPhone 7 Plus";

        if([phoneModelisEqualToString:@"iPhone10,1"] ||

            [phoneModelisEqualToString:@"iPhone10,4"])return@"iPhone 8";

        if([phoneModelisEqualToString:@"iPhone10,2"] ||

            [phoneModelisEqualToString:@"iPhone10,5"]) return @"iPhone 8 Plus";

        if([phoneModelisEqualToString:@"iPhone10,3"] ||

            [phoneModelisEqualToString:@"iPhone10,6"])return@"iPhone X";

        if ([phoneModel isEqualToString:@"iPhone11,1"]) return @"iPhone XR";

        if ([phoneModel isEqualToString:@"iPhone11,3"]) return @"iPhone XS";

        if ([phoneModel isEqualToString:@"iPhone11,5"]) return @"iPhone XS Max";

        if([phoneModelisEqualToString:@"iPad1,1"])return@"iPad";

        if([phoneModelisEqualToString:@"iPad2,1"] ||

            [phoneModelisEqualToString:@"iPad2,2"] ||

            [phoneModelisEqualToString:@"iPad2,3"] ||

            [phoneModelisEqualToString:@"iPad2,4"])return@"iPad 2";

        if([phoneModelisEqualToString:@"iPad3,1"] ||

            [phoneModelisEqualToString:@"iPad3,2"] ||

            [phoneModelisEqualToString:@"iPad3,3"])return@"iPad 3";

        if([phoneModelisEqualToString:@"iPad3,4"] ||

            [phoneModelisEqualToString:@"iPad3,5"] ||

            [phoneModelisEqualToString:@"iPad3,6"])return@"iPad 4";

        if([phoneModelisEqualToString:@"iPad4,1"] ||

            [phoneModelisEqualToString:@"iPad4,2"] ||

            [phoneModelisEqualToString:@"iPad4,3"])return@"iPad Air";

        if([phoneModelisEqualToString:@"iPad5,3"] ||

            [phoneModelisEqualToString:@"iPad5,4"])return@"iPad Air 2";

        if([phoneModelisEqualToString:@"iPad6,3"] ||

            [phoneModelisEqualToString:@"iPad6,4"]) return @"iPad Pro 9.7-inch";

        if([phoneModelisEqualToString:@"iPad6,7"] ||

            [phoneModelisEqualToString:@"iPad6,8"]) return @"iPad Pro 12.9-inch";

        if([phoneModelisEqualToString:@"iPad6,11"] ||

            [phoneModelisEqualToString:@"iPad6,12"])return@"iPad 5";

        if([phoneModelisEqualToString:@"iPad7,1"] ||

            [phoneModelisEqualToString:@"iPad7,2"]) return @"iPad Pro 12.9-inch 2";

        if([phoneModelisEqualToString:@"iPad7,3"] ||

            [phoneModelisEqualToString:@"iPad7,4"]) return @"iPad Pro 10.5-inch";

        if([phoneModelisEqualToString:@"iPad2,5"] ||

            [phoneModelisEqualToString:@"iPad2,6"] ||

            [phoneModelisEqualToString:@"iPad2,7"])return@"iPad mini";

        if([phoneModelisEqualToString:@"iPad4,4"] ||

            [phoneModelisEqualToString:@"iPad4,5"] ||

            [phoneModelisEqualToString:@"iPad4,6"])return@"iPad mini 2";

        if([phoneModelisEqualToString:@"iPad4,7"] ||

            [phoneModelisEqualToString:@"iPad4,8"] ||

            [phoneModelisEqualToString:@"iPad4,9"])return@"iPad mini 3";

        if([phoneModelisEqualToString:@"iPad5,1"] ||

            [phoneModelisEqualToString:@"iPad5,2"])return@"iPad mini 4";

        if([phoneModelisEqualToString:@"iPad6,3"] ||

            [phoneModelisEqualToString:@"iPad6,4"]) return @"9.7-inch iPad Pro";

        if([phoneModelisEqualToString:@"iPad6,11"] ||

            [phoneModelisEqualToString:@"iPad6,12"])return@"iPad";

        if ([phoneModel isEqualToString:@"iPad7,4"]) return @"10.5-inch iPad Pro";

        if([phoneModelisEqualToString:@"iPad8,1"] ||

            [phoneModelisEqualToString:@"iPad8,2"]) return @"11-inch iPad Pro";

        if([phoneModelisEqualToString:@"iPad8,5"] ||

            [phoneModelisEqualToString:@"iPad8,6"]) return @"12.9-inch iPad Pro";

        if([phoneModelisEqualToString:@"iPod1,1"])return@"iTouch";

        if([phoneModelisEqualToString:@"iPod2,1"])return@"iTouch2";

        if([phoneModelisEqualToString:@"iPod3,1"])return@"iTouch3";

        if([phoneModelisEqualToString:@"iPod4,1"])return@"iTouch4";

        if([phoneModelisEqualToString:@"iPod5,1"])return@"iTouch5";

        if([phoneModelisEqualToString:@"iPod7,1"])return@"iTouch6";

        if([phoneModelisEqualToString:@"i386"] ||

            [phoneModelisEqualToString:@"x86_64"]) return @"iPhone Simulator";

        return @"Unknown";

    }

    相关文章

      网友评论

          本文标题:根据iOS设备型号判断设备

          本文链接:https://www.haomeiwen.com/subject/bguxjqtx.html