Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pmairoldi/01626254b61658a04cc8 to your computer and use it in GitHub Desktop.
Save pmairoldi/01626254b61658a04cc8 to your computer and use it in GitHub Desktop.
- (NSString *)deviceIdentifier NS_AVAILABLE_IOS(8_0) {
UIScreen *screen = [UIScreen mainScreen];
CGSize size = screen.nativeBounds.size;
CGFloat scale = screen.nativeScale;
NSString *identifier = [NSString stringWithFormat:@"w_%.00f_h_%.00f", size.width / scale , size.height / scale];
return identifier;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment