daily pastebin goal
46%
SHARE
TWEET

Untitled

a guest Jan 22nd, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top