Skip to content

Instantly share code, notes, and snippets.

@cobysy
Created July 3, 2014 22:50
Show Gist options
  • Save cobysy/473499b8259b14e0d512 to your computer and use it in GitHub Desktop.
Save cobysy/473499b8259b14e0d512 to your computer and use it in GitHub Desktop.
Get device size on iOS device
- (CGSize)deviceSize
{
CGSize size = [UIScreen mainScreen].bounds.size;
if ([UIScreen instancesRespondToSelector:@selector(scale)] && [[UIScreen mainScreen] scale] > 1) {
size = CGSizeMake(size.width * 2, size.height * 2); // Retina screenshot size support
}
return size;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment