Guest User

Untitled

a guest
Jan 22nd, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone){
  2. if ([[UIScreen mainScreen] respondsToSelector: @selector(scale)]) {
  3. CGSize result = [[UIScreen mainScreen] bounds].size;
  4. CGFloat scale = [UIScreen mainScreen].scale;
  5. result = CGSizeMake(result.width * scale, result.height * scale);
  6.  
  7. if(result.height == 960) {
  8. NSLog(@"iPhone 4 Resolution");
  9. resolution_number = 1;
  10. }
  11. if(result.height == 1136) {
  12. NSLog(@"iPhone 5 Resolution");
  13. }
  14. }
  15. else{
  16. NSLog(@"Standard Resolution");
  17. }
  18. }
Add Comment
Please, Sign In to add comment