iTunes can detect if my iPhone is black or white, so how can I do this in code?
I'm thinking it would be a UIDevice thing but I'm not too sure.
iTunes can detect if my iPhone is black or white, so how can I do this in code?
I'm thinking it would be a UIDevice thing but I'm not too sure.
You can obtain color from model part number, for example:
MD381 - black iPhone 4S
MC920 - white iPhone 4S
...
To obtain model number use uidevice-extension
Addition: Alternative solution. Link your project with libLockdown.dylib.
extern id lockdown_connect();
extern id lockdown_copy_value(id, id, id);
extern void lockdown_disconnect();
extern NSString *kLockdownDeviceColorKey;
NSString* CopyDeviceColor() {
id connection = lockdown_connect();
NSString *color = lockdown_copy_value(connection, nil, kLockdownDeviceColorKey);
NSLog(@"color = %@", color);
lockdown_disconnect(connection);
return color;
}
iTunes detects the color of the device from the serial number I believe.
There is no way to determine the color of the device or developers.