Get iPhone Color iOS Sdk

iTunes can determine if my iPhone is black or white, so how can I do this in code?

I think it will be a UIDevice, but I'm not sure.

+6
source share
2 answers

You can get the color from the model number, for example:

MD381 - Black iPhone 4S

MC920 - White iPhone 4S

...

To get the model number, use uidevice-extension

Addendum : An 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; } 
+10
source

iTunes determines the color of the device from the serial number that I count.

Unable to determine the color of the device or developers.

+2
source

Source: https://habr.com/ru/post/917445/


All Articles