Usually, I use the below code to identify the iOS version of the device.
if ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0)
In
Ricster explained clearly about all the methods to identify the device which supports metal at runtime. If you cannot use MTLCreateSystemDefaultDevice() in your class by including metal libraries, use device informations(iOS version,gpu/cpu architecture),but you need to consider all the cases explained by Ricster when using device informations.
void deviceConfigurations(){
size_t size;
cpu_type_t type;
cpu_subtype_t subtype;
size = sizeof(type);
sysctlbyname("hw.cputype", &type, &size, NULL, 0);
size = sizeof(subtype);
sysctlbyname("hw.cpusubtype", &subtype, &size, NULL, 0);
}
Use Subtype and type variable to identify device and other informations.