Skip to content

Instantly share code, notes, and snippets.

@futuretap
Last active December 25, 2015 04:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save futuretap/6920492 to your computer and use it in GitHub Desktop.
Save futuretap/6920492 to your computer and use it in GitHub Desktop.
Logs iOS device color and device enclosure color. Attention: private API, do not use in App Store builds!
UIDevice *device = [UIDevice currentDevice];
SEL selector = NSSelectorFromString([device.systemVersion hasPrefix:@"7"] ? @"_deviceInfoForKey:" : @"deviceInfoForKey:");
NSLog(@"DeviceColor: %@ DeviceEnclosureColor: %@", [device performSelector:selector withObject:@"DeviceColor"], [device performSelector:selector withObject:@"DeviceEnclosureColor"]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment