IOS get current Apple device model code:
-(nsstring*) Dodeviceplatform
{
size_t size;
int NR = Sysctlbyname ("Hw.machine", NULL, &size, null,0);
Char*machine = (char*) malloc (size);
NR = Sysctlbyname ("Hw.machine", Machine, &size,null, 0);
NSString *platform = [NSString stringwithcstring:machine encoding:nsutf8stringencoding];
Free (machine);
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 (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 Plus";
if ([Platform isequaltostring:@ "iphone7,2"]) return @ "IPhone 6";
if ([Platform isequaltostring:@ "iphone8,1"]) return @ "IPhone 6s Plus";
if ([Platform isequaltostring:@ "iphone8,2"]) return @ "IPhone 6s";
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,4"]) return @ "IPad Mini 2G (WiFi)";
if ([Platform isequaltostring:@ "ipad4,5"]) return @ "IPad Mini 2G (cellular)";
if ([Platform isequaltostring:@ "ipad5,1"]) return @ "IPad Mini 4 (WiFi)";
if ([Platform isequaltostring:@ "ipad5,2"]) return @ "IPad Mini 4 (cellular)";
if ([Platform isequaltostring:@ "ipad6,8"]) return @ "IPad Pro";
if ([Platform isequaltostring:@ "i386"]) return @ "Simulator";
if ([Platform isequaltostring:@ "x86_64"]) return @ "Simulator";
return platform;
}