Created
July 3, 2014 22:50
-
-
Save cobysy/473499b8259b14e0d512 to your computer and use it in GitHub Desktop.
Get device size on iOS device
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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