I watched Apple's September presentation on Apple TV.
One question, can we tell what colour the iPhone is?
I remember reading a few months ago about how to get the home screen image so that your app could have the same frosted glass look that the phone app does. I imagine that's more useful for what you're trying to do than the color of the phone itself, which may, after all, have a case of any color on it, which you certainly wouldn't know. If the color of the exterior of the phone is really necessary, it might be best (and easiest) to just ask the user what color it is.
ALways thought the current one should know if it's black or white too,
just for a background theme.
Then will come the jailbreak hack to switch colours.
I presume the iOS must know, unless iOS asks the user the colour during their iPhone setup,
but I think this would make Apple look a little silly too.
I watched Apple's September presentation on Apple TV.
One question, can we tell what colour the iPhone is?
iTunes knows the color of all the supported devices I connect to my Mac. All my iOS devices are black, so I can't do much testing with those. But I have various colors of iPods of several generations; iTunes shows the actual color for all of them.
I don't know if iTunes is asking the devices what color they are or deriving the color from something else. (The color might be encoded in the serial number, for example.)
[[UIDevice currentDevice] _deviceInfoForKey:@"DeviceEnclosureColor"]; // Detect back plate color of device.
[[UIDevice currentDevice] _deviceInfoForKey:@"DeviceColor"]; // Detect white or black iOS device.
Saw two tweets (1,2) on this subject by @stroughtonsmith. A few responses suggest this may be a private API. Given that, it is likely useless for any app you want to have on the App Store.
This seems to be limited to iOS 7. The return values are hex strings such as #d7d9d8. Oh yea, had to place the calls into a memory managed object. ARC doesn't like it.
Code:[[UIDevice currentDevice] _deviceInfoForKey:@"DeviceEnclosureColor"]; // Detect back plate color of device. [[UIDevice currentDevice] _deviceInfoForKey:@"DeviceColor"]; // Detect white or black iOS device.
EDIT,,,
I thought that would be their white, but it actually looks too grey:
http://html-color-codes.info
Can't actually try it on a device ATM they have iOS7.
Saw two tweets (1,2) on this subject by @stroughtonsmith. A few responses suggest this may be a private API. Given that, it is likely useless for any app you want to have on the App Store.
This seems to be limited to iOS 7. The return values are hex strings such as #d7d9d8. Oh yea, had to place the calls into a memory managed object. ARC doesn't like it.
Code:[[UIDevice currentDevice] _deviceInfoForKey:@"DeviceEnclosureColor"]; // Detect back plate color of device. [[UIDevice currentDevice] _deviceInfoForKey:@"DeviceColor"]; // Detect white or black iOS device.
I don't think the API is private, because I once searched for a way to figure out if the device is an iPhone or iPad and someone pointed to the currentDevice object filled with information about the device.
currentDevice is not the private API. It's _deviceInfoForKey. Method names that start with underscores are almost certainly private.
Can you tell how they are found in the first place?
I haven't looked in any framework headers, but if we can't use them,
why would we even be supplied with them?
It would be interesting to know what is out there for personal apps that aren't destined for the App Store.